Internal
Protected
_assignProtected
_setAttribute/path to append to, eg comments
or person.hobbies
Array of items to append to the array
Decrement a numeric value. Each entry in the argument is either an attribute or a JSON path. The value may be a positive or negative integer or floating-point value. The operation will fail if target value is not a numeric value, or doesn't exist.
Object of attribute paths to decrement, values representing the number to decrement by.
Performs a "diff-match-patch" operation on the string attributes provided.
The operation is added to the current patch, ready to be commited by commit()
Attributes to perform operation on. To set a deep attribute, use JSONMatch, eg: {"nested.prop": "dmp"}
Adds a revision clause, preventing the document from being patched if the _rev
property does not match the given value
Revision to lock the patch to
Increment a numeric value. Each entry in the argument is either an attribute or a JSON path. The value may be a positive or negative integer or floating-point value. The operation will fail if target value is not a numeric value, or doesn't exist.
Object of attribute paths to increment, values representing the number to increment by.
Provides methods for modifying arrays, by inserting, appending and replacing elements via a JSONPath expression.
Location to insert at, relative to the given selector, or 'replace' the matched path
JSONPath expression, eg comments[-1]
or blocks[_key=="abc123"]
Array of items to insert/replace
Prepend the given items to the array at the given JSONPath
Attribute/path to prepend to, eg comments
or person.hobbies
Array of items to prepend to the array
Clears the patch of all operations
Return a plain JSON representation of the patch
Sets the given attributes to the document. Does NOT merge objects.
The operation is added to the current patch, ready to be commited by commit()
Attributes to set. To set a deep attribute, use JSONMatch, eg: {"nested.prop": "value"}
Sets the given attributes to the document if they are not currently set. Does NOT merge objects.
The operation is added to the current patch, ready to be commited by commit()
Attributes to set. To set a deep attribute, use JSONMatch, eg: {"nested.prop": "value"}
Change the contents of an array by removing existing elements and/or adding new elements.
Attribute or JSONPath expression for array
Index at which to start changing the array (with origin 0). If greater than the length of the array, actual starting index will be set to the length of the array. If negative, will begin that many elements from the end of the array (with origin -1) and will be set to 0 if absolute value is greater than the length of the array.x
Optional
deleteCount: numberAn integer indicating the number of old array elements to remove.
Optional
items: any[]The elements to add to the array, beginning at the start index. If you don't specify any elements, splice() will only remove elements from the array.
Return a plain JSON representation of the patch
Unsets the attribute paths provided.
The operation is added to the current patch, ready to be commited by commit()
Attribute paths to unset.
Append the given items to the array at the given JSONPath