Data Store Query Operators

N/dataStore supports logical operators for combining query conditions and operators for specifying conditions on document fields.

For more information about query operators, see the following sections:

Logical Operators

Logical operators combine query objects into condition groups. Use them as properties of a query object, with an array of query objects as the value. For more information about constructing condition groups, see Query Object Structure.

The following table lists the supported logical operators that you can use as query object properties.

The following example combines $and and $or to create nested condition groups.

            {
  "$and": [
    {
      "status": "pending"
    },
    {
      "$or": [
        {
          "priority": "high"
        },
        {
          "attemptCount": {
            "$lt": 3
          }
        }
      ]
    }
  ]
} 

          

This query matches documents with a status of 'pending' and either a priority of 'high' or an attemptCount below 3.

Field Condition Operators

Field condition operators specify conditions for comparing field values, matching values in a list, checking whether fields exist, or matching array elements. For more information about applying operators to document fields, see Query Object Structure.

For examples of using these operators to query array elements, see Data Store Array Queries.

The following table lists the supported operators for specifying conditions on document fields. For limits on string and numeric comparison values, see Data Store Query Limits.

Related Topics

General Notices