Query Selectors
Comparison
Name | Description (a operator b) |
$eq | Matches values that are equal to a specified value. (a=b :true) |
$gt | Matches values that are greater than a specified value. (a>b :true) |
$gte | Matches values that are greater than or equal to a specified value.
(a>=b : true) |
$lt | Matches values that are less than a specified value. (a<b :true) |
$lte | Matches values that are less than or equal to a specified value. (a<=b :true) |
$ne | Matches all values that are not equal to a specified value. (a =!b :true) |
$in | Matches any of the values specified in an array. (b includes a :true) |
$nin | Matches none of the values specified in an array. (b doesn't have a :true) |
Logical
Name | Description |
$or | Joins query clauses with a logical OR returns all documents that match the conditions of either clause. |
$and | Joins query clauses with a logical AND returns all documents that match the conditions of both clauses. |
$not | Inverts the effect of a query expression and returns documents that do not match the query expression. (쿼리의 결과를 반대로 뒤집고 쿼리조건에 해당하지 않는 document만 반환한다) |
$nor | Joins query clauses with a logical NOR returns all documents that fail to match both clauses. (이 조건에 매치되지 않는 documents만 반환.) |
Element
Name | Description |
$exists | Matches documents that have the specified field.
(특정 field를 갖는 document만 반환) |
$type | Selects documents if a field is of the specified type.
(특정 타입의 field를 갖는 document만 반환) |
Evaluation
Name | Description |
$mod | Performs a modulo operation on the value of a field and selects documents with a specified result. |
$regex | Selects documents where values match a specified regular expression.
특정 정규식에 맞는 documents를 반환함. |
$text | Performs text search.
문자열을 검색함. |
$where | Matches documents that satisfy a JavaScript expression.
js 식으로 작성한 document를 반환. |
Array
Name | Description |
$all | Matches arrays that contain all elements specified in the query. |
$elemMatch | Selects documents if element in the array field matches all the specified $elemMatchconditions. |
$size | Selects documents if the array field is a specified size. |
Bitwise
Name | Description |
$bitsAllSet | Matches numeric or binary values in which a set of bit positions all have a value of 1. |
$bitsAnySet | Matches numeric or binary values in which any bit from a set of bit positions has a value of1. |
$bitsAllClear | Matches numeric or binary values in which a set of bit positions all have a value of 0. |
$bitsAnyClear | Matches numeric or binary values in which any bit from a set of bit positions has a value of0. |
Projection Operators
Name | Description |
$ | Projects the first element in an array that matches the query condition. |
$elemMatch | Projects the first element in an array that matches the specified $elemMatchcondition. |
$meta | Projects the document’s score assigned during $text operation. |
$slice | Limits the number of elements projected from an array. Supports skip and limit slices. |
EmoticonEmoticon