-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Server
-
Labels:
SERVER-18819 introduced string aliases for the $type query operator. Whereas previously you could query for, say, all documents where field a is a NumberLong using
db.coll.find({a: {$type: 18}});
now you can use the much more readable
db.coll.find({a: {$type: "long"}});
The string alias accepted for each BSONType are listed in SERVER-18819. We need to add these to the $type docs here: http://docs.mongodb.org/manual/reference/operator/query/type/
We should also consider updating http://docs.mongodb.org/manual/reference/bson-types/ to list the short names for each type.
- documents
-
SERVER-18819 Allow $type to support type values as string names
- Closed
- is related to
-
DOCS-5838 $type operator supports "number"
- Closed