-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Labels:
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}}}
- related to
-
SERVER-85768 Improve error message when $documents stage is used on a collection aggregation
- Open