Details
-
New Feature
-
Resolution: Done
-
Minor - P4
-
None
-
1.5.1
-
None
-
Query
Description
Obtaining counts for large attributes can be a pain. Approaches are to:
1) Return the entire array and examine length
2) group/reduce and output the length
3) map/reduce to get length
4) ensure documents maintain length attribute across document lifespan
I think being able to request embedded array length directly would be helpful.
Perhaps something like:
db.collection.find({}, {some_array: {$count: true}})