You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report. This is happening because $documents is only available when calling db.aggregate() (ie, not running aggregation on a specific collection). This is not supported by the playground yet and might be tricky to implement, so the best solution for now is to remove the $documents stage, put the documents in an other collection, and run the aggregation on this collection.
Just to note a workaround, we can select no document by _id: {$exists: false} and then put the $documents stage in an $unionWith pipeline as a workaround in playground.
When I try to use
$documents
operator in playground,I get below error:
Playground to reproduce.
Alternatives that I have tried(but also failed):
Removing
collection
indb.collection.aggregate([...])
: will get syntax error like:Playground
What could be a correct way to use
$documents
in Mongo Playground?The text was updated successfully, but these errors were encountered: