[−][src]Module mongodm::operator
Static operators for queries to prevent invalid queries due to typos.
See mongo manual for query operators and update operators.
If an operator is missing, you can easily add it yourself (also, PR are welcomed) or use the hardcoded string like you would in a mongo shell.
use mongodm::mongo::bson::doc; use mongodm::operator::*; // Using static operators let a = doc! { And: [ { "foo": { Exists: true } }, { Or: [ { "bar": { GreaterThan: 100 } }, { "lorem": "ipsum" } ] } ] }; // Using hardcoded strings let b = doc! { "$and": [ { "foo": { "$exists": true } }, { "$or": [ { "bar": { "$gt": 100 } }, { "lorem": "ipsum" } ] } ] }; // Generated document are identicals assert_eq!(a, b);
Structs
AddToSet |
Array (update)
operator |
All |
Array (query)
operator |
And |
Logical
operator |
Bit |
Bitwise (update)
operator |
BitsAllClear |
Bitwise (query)
operator |
BitsAllSet |
Bitwise (query)
operator |
BitsAnyClear |
Bitwise (query)
operator |
BitsAnySet |
Bitwise (query)
operator |
Comment |
Comments
operator |
CurrentDate |
Fields
operator |
Each |
Modifiers
operator |
ElemMatch |
Array (query)
operator |
Equal |
Comparison
operator |
Exists |
Element
operator |
Expr |
Evaluation
operator |
GeoIntersects |
Geospatial
operator |
GeoWithin |
Geospatial
operator |
GreaterThan |
Comparison
operator |
GreaterThanEqual |
Comparison
operator |
In |
Comparison
operator |
Inc |
Fields
operator |
JsonSchema |
Evaluation
operator |
LesserThan |
Comparison
operator |
LesserThanEqual |
Comparison
operator |
Max |
Fields
operator |
Meta |
Projection
operator |
Min |
Fields
operator |
Mod |
Evaluation
operator |
Mul |
Fields
operator |
Near |
Geospatial
operator |
NearSphere |
Geospatial
operator |
NoneIn |
Comparison
operator |
Nor |
Logical
operator |
Not |
Logical
operator |
NotEqual |
Comparison
operator |
Or |
Logical
operator |
Pop |
Array (update)
operator |
Position |
Modifiers
operator |
ProjectFirst |
Projection
operator |
Pull |
Array (update)
operator |
PullAll |
Array (update)
operator |
Push |
Array (update)
operator |
Regex |
Evaluation
operator |
Rename |
Fields
operator |
Set |
Fields
operator |
SetOnInsert |
Fields
operator |
Size |
Array (query)
operator |
Slice |
Projection
operator |
Sort |
Modifiers
operator |
Text |
Evaluation
operator |
Type |
Element
operator |
Unset |
Fields
operator |
UpdateAllDocuments |
Array (update)
operator |
UpdateFirstDocument |
Array (update)
operator |
Where |
Evaluation
operator |