UpsertOptions extends QueryOptions
Table of Contents
Constants
- CACHE_ENABLED : string = 'cacheEnabled'
- DEDUPLICATE : string = 'deduplicate'
- DISABLE_INDEX : string = 'disableIndex'
- ESTIMATES : string = 'estimates'
- EXCLUSIVE : string = 'exclusive'
- EXPIRE_AFTER : string = 'expireAfter'
- FIELD_VALUE_TYPES : string = 'fieldValueTypes'
- FIELDS : string = 'fields'
- FORCE_INDEX_HINT : string = 'forceIndexHint'
- GEO_JSON : string = 'geoJson'
- IGNORE_ERRORS : string = 'ignoreErrors'
- IGNORE_REVS : string = 'ignoreRevs'
- IN_BACKGROUND : string = 'inBackground'
- INDEX_HINT : string = 'indexHint'
- KEEP_NULL : string = 'keepNull'
- LEGACY_POLYGONS : string = 'legacyPolygons'
- LOOKAHEAD : string = 'lookahead'
- MAX_PROJECTIONS : string = 'maxProjections'
- MERGE_OBJECTS : string = 'mergeObjects'
- METHOD : string = 'method'
- NAME : string = 'name'
- OVERWRITE_MODE : string = 'overwriteMode'
- PARALLELISM : string = 'parallelism'
- PARAMS : string = 'params'
- PREFIX_FIELDS : string = 'prefixFields'
- READ_OWN_WRITES : string = 'readOwnWrites'
- REFILL_INDEX_CACHES : string = 'refillIndexCaches'
- SPARSE : string = 'sparse'
- STORED_VALUE : string = 'storedValue'
- TYPE : string = 'type'
- UNIQUE : string = 'unique'
- USE_CACHE : string = 'useCache'
- WAIT_FOR_SYNC : string = 'waitForSync'
Properties
- $exclusive : bool
- The RocksDB engine does not require collection-level locks. Different write operations on the same collection do not block each other, as long as there are no write-write conflicts on the same documents.
- $forceIndexHint : bool
- Makes the index or indexes specified in indexHint mandatory if enabled. The default is false.
- $ignoreErrors : bool
- Suppress query errors that may occur when trying to update non-existing documents or when violating unique key constraints.
- $ignoreRevs : bool
- In order to not accidentally overwrite documents that have been modified since you last fetched them, you can use the option ignoreRevs to either let ArangoDB compare the _rev value and only succeed if they still match, or let ArangoDB ignore them (default).
- $indexHint : string|null
- The indexHint option is used as a hint for the document lookup performed as part of the UPSERT operation, and can help in cases such as UPSERT not picking the best index automatically.
- $keepNull : bool
- When updating an attribute to the null value, ArangoDB does not remove the attribute from the document but stores this null value.
- $mergeObjects : bool
- The option mergeObjects controls whether object contents are merged if an object attribute is present in both the UPDATE query and in the to-be-updated document.
- $readOwnWrites : bool
- The readOwnWrites option allows an UPSERT operation to process its inputs one by one.
- $waitForSync : bool
- To make sure data are durable when an update query returns.
Methods
- __construct() : mixed
- Creates a new QueryOptions instance.
- jsonSerialize() : array<string|int, mixed>
- Invoked to serialize the object with the json serializer.
Constants
CACHE_ENABLED
public
string
CACHE_ENABLED
= 'cacheEnabled'
DEDUPLICATE
public
string
DEDUPLICATE
= 'deduplicate'
DISABLE_INDEX
public
string
DISABLE_INDEX
= 'disableIndex'
ESTIMATES
public
string
ESTIMATES
= 'estimates'
EXCLUSIVE
public
string
EXCLUSIVE
= 'exclusive'
EXPIRE_AFTER
public
string
EXPIRE_AFTER
= 'expireAfter'
FIELD_VALUE_TYPES
public
string
FIELD_VALUE_TYPES
= 'fieldValueTypes'
FIELDS
public
string
FIELDS
= 'fields'
FORCE_INDEX_HINT
public
string
FORCE_INDEX_HINT
= 'forceIndexHint'
GEO_JSON
public
string
GEO_JSON
= 'geoJson'
IGNORE_ERRORS
public
string
IGNORE_ERRORS
= 'ignoreErrors'
IGNORE_REVS
public
string
IGNORE_REVS
= 'ignoreRevs'
IN_BACKGROUND
public
string
IN_BACKGROUND
= 'inBackground'
INDEX_HINT
public
string
INDEX_HINT
= 'indexHint'
KEEP_NULL
public
string
KEEP_NULL
= 'keepNull'
LEGACY_POLYGONS
public
string
LEGACY_POLYGONS
= 'legacyPolygons'
LOOKAHEAD
public
string
LOOKAHEAD
= 'lookahead'
MAX_PROJECTIONS
public
string
MAX_PROJECTIONS
= 'maxProjections'
MERGE_OBJECTS
public
string
MERGE_OBJECTS
= 'mergeObjects'
METHOD
public
string
METHOD
= 'method'
NAME
public
string
NAME
= 'name'
OVERWRITE_MODE
public
string
OVERWRITE_MODE
= 'overwriteMode'
PARALLELISM
public
string
PARALLELISM
= 'parallelism'
PARAMS
public
string
PARAMS
= 'params'
PREFIX_FIELDS
public
string
PREFIX_FIELDS
= 'prefixFields'
READ_OWN_WRITES
public
string
READ_OWN_WRITES
= 'readOwnWrites'
REFILL_INDEX_CACHES
public
string
REFILL_INDEX_CACHES
= 'refillIndexCaches'
SPARSE
public
string
SPARSE
= 'sparse'
STORED_VALUE
public
string
STORED_VALUE
= 'storedValue'
TYPE
public
string
TYPE
= 'type'
UNIQUE
public
string
UNIQUE
= 'unique'
USE_CACHE
public
string
USE_CACHE
= 'useCache'
WAIT_FOR_SYNC
public
string
WAIT_FOR_SYNC
= 'waitForSync'
Properties
$exclusive
The RocksDB engine does not require collection-level locks. Different write operations on the same collection do not block each other, as long as there are no write-write conflicts on the same documents.
public
bool
$exclusive
From an application development perspective it can be desired to have exclusive write access on collections, to simplify the development. Note that writes do not block reads in RocksDB. Exclusive access can also speed up modification queries, because we avoid conflict checks.
Tags
$forceIndexHint
Makes the index or indexes specified in indexHint mandatory if enabled. The default is false.
public
bool
$forceIndexHint
Also see forceIndexHint Option of the FOR Operation.
Tags
$ignoreErrors
Suppress query errors that may occur when trying to update non-existing documents or when violating unique key constraints.
public
bool
$ignoreErrors
Tags
$ignoreRevs
In order to not accidentally overwrite documents that have been modified since you last fetched them, you can use the option ignoreRevs to either let ArangoDB compare the _rev value and only succeed if they still match, or let ArangoDB ignore them (default).
public
bool
$ignoreRevs
Tags
$indexHint
The indexHint option is used as a hint for the document lookup performed as part of the UPSERT operation, and can help in cases such as UPSERT not picking the best index automatically.
public
string|null
$indexHint
UPSERT { a: 1234 }
INSERT { a: 1234, name: "AB" }
UPDATE { name: "ABC" } IN myCollection
OPTIONS { indexHint: "index_name" }
The index hint is passed through to an internal FOR loop that is used for the lookup.
Also see indexHint Option of the FOR Operation.
Inverted indexes cannot be used for UPSERT lookups.
Tags
$keepNull
When updating an attribute to the null value, ArangoDB does not remove the attribute from the document but stores this null value.
public
bool
$keepNull
To remove attributes in an update operation, set them to null and set the keepNull option to false. Only top-level attributes and sub-attributes can be removed this way (e.g. { attr: { sub: null } }) but not attributes of objects that are nested inside of arrays (e.g. { attr: [ { nested: null } ] }).
Tags
$mergeObjects
The option mergeObjects controls whether object contents are merged if an object attribute is present in both the UPDATE query and in the to-be-updated document.
public
bool
$mergeObjects
Tags
$readOwnWrites
The readOwnWrites option allows an UPSERT operation to process its inputs one by one.
public
bool
$readOwnWrites
The default value is true. When enabled, the UPSERT operation can observe its own writes and can handle modifying the same target document multiple times in the same query. When the option is set to false, an UPSERT operation processes its inputs in batches. Normally, a batch has 1000 inputs, which can lead to a faster execution. However, when using batches, the UPSERT operation can essentially not observe its own writes. You should only set the readOwnWrites option to false if you can guarantee that the input of the UPSERT leads to disjoint documents being inserted, updated, or replaced.
Tags
$waitForSync
To make sure data are durable when an update query returns.
public
bool
$waitForSync
Tags
Methods
__construct()
Creates a new QueryOptions instance.
public
__construct([array<string|int, mixed>|object|null $init = null ]) : mixed
Parameters
- $init : array<string|int, mixed>|object|null = null
-
A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.
jsonSerialize()
Invoked to serialize the object with the json serializer.
public
jsonSerialize() : array<string|int, mixed>