Advanced Document Store Querying

Operators and patterns for filtering, updating, and modifying documents in your Cloud Function's Document Store.

The Document Store is built on MongoDB, so its query and update operators follow MongoDB syntax. This page lists the operators you can use and that IXON supports; for full semantics and examples beyond what's covered here, the MongoDB operator reference applies.

If you're new to the Document Store, start with Document Store.

Select operators

Use these operators to find and filter documents and subdocuments.

NameDescription
$andLogical AND across query clauses.
$notInverts a query expression.
$norReturns documents that fail to match either clause.
$orLogical OR across query clauses.
$existsMatches documents that have the specified field.
$typeMatches documents where a field is of the specified type.
$allMatches arrays containing all specified elements.
$elemMatchMatches documents where an array element matches the inner conditions.
$sizeMatches arrays of a given size.

Update operators

Field operators

NameDescription
$currentDateSets a field to the current date.
$incIncrements a field.
$minUpdates only if the new value is less than the current.
$maxUpdates only if the new value is greater than the current.
$mulMultiplies a field.
$renameRenames a field.
$setSets a field's value.
$setOnInsertSets a field only on insert (no effect on plain updates).
$unsetRemoves a field.

Array operators

NameDescription
$Placeholder for the first matching array element.
$[]Placeholder for all elements in an array.
$[<identifier>]Placeholder for elements matching arrayFilters.
$addToSetAdds elements to an array if not already present.
$popRemoves the first or last array item.
$pullRemoves array elements matching a query.
$pushAppends an item to an array.
$pullAllRemoves all matching values from an array.

Modifier operators

NameDescription
$eachModifies $push and $addToSet to append multiple items.
$positionSpecifies position for $push.
$sliceLimits the size of arrays after $push.
$sortReorders array elements after $push.