Data evaluation operators

JSON Data evaluation operators provide ways to locate data within the database. They work in different manners for queries on individual documents and aggregation queries.

For details about supported data evaluation operators in queries that are constructed by using aggregation tasks, see the topic about aggregation tasks and operators.

Table 1. Data evaluation operators
Operator Description Example
$size Returns the number of documents if the array field is of the specified size. {"arr":{"$size":4}}
$mod Performs a modulo operation on the value of the field and returns the document that meets the specified result.
  • The following query finds the value that has a remainder of 1 after it is divided by 4:
    {"age":{"$mod":[4,1]}} 
  • The following query finds the value that has a remainder of 0 after it is divided by 5:
    {"age":{"$mod":[5]}}