addObject
- If a record with the specified object ID doesn’t exist,
a new record is added to the index if
createIfNotExists
is true. - If the index doesn’t exist yet, this method creates a new index.
- You can use any first-level attribute but not nested attributes. If you specify a nested attribute, this operation replaces its first-level ancestor.
- Increment: increment a numeric attribute
- Decrement: decrement a numeric attribute
- Add: append a number or string element to an array attribute
- Remove: remove all matching number or string elements from an array attribute made of numbers or strings
- AddUnique: add a number or string element to an array attribute made of numbers or strings only if it’s not already present
- IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn’t exist, the engine only creates it if you pass an IncrementFrom value of 0.
- IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn’t exist yet, the engine only creates it if you pass an IncrementSet value greater than 0.
- _operation: the operation to apply on the attribute
- value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
Usage
See the full API reference
For more details about input parameters
and response fields.