Details
-
Improvement
-
Resolution: Won't Do
-
Minor - P4
-
None
-
None
-
None
Description
Many of the driver implementations have projection syntax which allows fields to be specified as a list/array or a hash/dictionary (default). It would be helpful if the mongo shell included similar syntactic sugar for including & excluding fields.
A few examples:
- Ruby: http://api.mongodb.org/ruby/current/Mongo/Collection.html#find-instance_method
- Python: http://api.mongodb.org/python/current/api/pymongo/collection.html#pymongo.collection.Collection.find
Conceptually this might be something similar to:
db.zips.find({state:'NY'}, includeFields("city","zip","pop"))
|
Which would be equivalent to:
db.zips.find({state:'NY'}, { "city" : 1, "zip" : 1, "pop" : 1 })
|