Details
-
Task
-
Resolution: Unresolved
-
Minor - P4
-
None
-
None
Description
The mongo server returns an error if we try to use the $documents stage as first stage of an aggregation run on a collection.
Enterprise test> db.test.aggregate([ { $documents: [{ nb: [1, 2, 3] }] }, { $project: { total: { $sum: ["$nb"] } } }] )
|
MongoServerError: '$documents' can only be run with {aggregate: 1}
|
I suggest updating the Behavior section of the $documents page to say so. Especially since the error message from the server is not very clear for someone that ignore the meaning of {{
{aggregate: 1}}}
Attachments
Issue Links
- related to
-
SERVER-85768 Improve error message when $documents stage is used on a collection aggregation
-
- Needs Scheduling
-