-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
Working with embedded array has improved so much with introduction of $[] and $[<identifier>] in v3.6, but still there is no easy way to sort the embedded documents or get their count. Adding these two operator to the projection would eliminate need of using aggregation framework for usual tasks:
db.collection.find( { field: value }, { array: {$slice: count, $sort: field, $size: newField} } );