Skip to content

$documents - query failed: (InvalidNamespace) '$documents' can only be run with {aggregate: 1} #169

Open
@GithubArray

Description

@GithubArray

When I try to use $documents operator in playground,

db.collection.aggregate([
  {
    "$documents": [
      {
        "test": 123
      }
    ]
  }
])

I get below error:

query failed: (InvalidNamespace) '$documents' can only be run with {aggregate: 1}

Playground to reproduce.


Alternatives that I have tried(but also failed):
Removing collection in db.collection.aggregate([...]): will get syntax error like:

Invalid query:

Line 1: Expected '.' instead of '('

Playground

What could be a correct way to use $documents in Mongo Playground?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions