-
Notifications
You must be signed in to change notification settings - Fork 84
Search Operators
o5faruk edited this page May 2, 2021
·
7 revisions
This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/search-operators/
-
$eqMatches values that are equal to a specified value. -
$gtMatches values that are greater than a specified value. -
$gteMatches values that are greater than or equal to a specified value. -
$ltMatches values that are less than a specified value. -
$lteMatches values that are less than or equal to a specified value. -
$neMatches all values that are not equal to a specified value. -
$inMatches any of the values specified in an array. -
$ninMatches none of the values specified in an array.
-
$orJoins query clauses with a logical OR returns all documents that match the conditions of either clause. -
$andJoins query clauses with a logical AND returns all documents that match the conditions of both clauses. -
$notInverts the effect of a query expression and returns documents that do not match the query expression. -
$norJoins query clauses with a logical NOR returns all documents that fail to match both clauses.
-
$existsMatches documents that have the specified field. -
$typeSelects documents if a field is of the specified type.
-
$modPerforms a modulo operation on the value of a field and selects documents with a specified result. -
$regexSelects documents where values match a specified regular expression.
#Array
-
$allMatches arrays that contain all elements specified in the query. -
$elemMatchSelects documents if element in the array field matches all the specified$elemMatchconditions. -
$sizeSelects documents if the array field is a specified size.
{
"qty": {"$gt": 0} // for quantities greater than zero
,"discontinued": 0 // and not discontinued
, "$or" : [
{"description": {"$regex":"/new /"}} // that has the word "new" in it
,{"description": {"$regex":"/hot /"}} // that has the word "hot" in it
]
}