Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-607

Syntax error in aggregation example?

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      http://docs.mongodb.org/manual/reference/command/aggregate/

      If I try using this as is:

      { $group : {
           _id : { tags : 1 },
           authors : { $addToSet : "$author" }
        }

      it'll give me

      exception: field inclusion is not allowed inside of $expressions

      Changing _id to _id: '$tags' gives the expected result.

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 18 weeks, 2 days ago