MongoDB aggregation error "every item in the pipeline must be a document"

I have a MongoDB aggregation that looks like this:

[
    {
        "$match": [
            {"Created": {"$gte": ISODate("2014-01-10T00:00:00Z")}}
        ]
    },
    {
        "$group":
        {
            "_id": [
                {"year": {"$year": "Created"}},
                {"month": {"$month": "Created"}},
                {"day": {"$dayOfMonth": "Created"}}
            ],
            "count": {"$sum": 1}
        }
    }
]

When I run this query in MongoVUE, it returns the following error:

Incorrect syntax in pipeline
Each item in the pipeline must be a document
Type: System.Exception
Stack: at MangoUI.ComAggregate.kRemove_Click (Object sender, EventArgs e)

I am completely at a dead end, and from my Googling, as well as the rest of Intenet-at-large. The request worked correctly before I added the $ match statement created by the day. It is possible that the error belongs to MongoVUE, and not to MongoDB itself.

The relevant part of the circuit is as follows:

{
  "_id" : new BinData(3, "m13wFpp9gUi09cRCuG43aw=="),
  "Created" : ISODate("2013-12-19T01:00:20.972Z")
}

Can someone help me find the cause of this error? I'm afraid I'm completely at a standstill.


( , -, 8 , StackOverflow ?) , :

. , , (, , ) MongoVUE. ( orid) :

{
  "$match": {
    "Created": {
      "$gte": ISODate("2014-01-10T00:00:00Z")
    }
  }
},
{
  "$group": {
    "_id": {
      "year": {
        "$year": "$Created"
      },
      "month": {
        "$month": "$Created"
      },
      "day": {
        "$dayOfMonth": "$Created"
      }
    },
    "count": {
      "$sum": 1
    }
  }
}

( , , , .)

, MongoVUE. , . , " ".

+4
1
pipeline = {
  "$match": {
    "Created": {
      "$gte": ISODate("2014-01-10T00:00:00Z")
    }
  }
},
{
  "$group": {
    "_id": {
      "year": {
        "$year": "$Created"
      },
      "month": {
        "$month": "$Created"
      },
      "day": {
        "$dayOfMonth": "$Created"
      }
    },
    "count": {
      "$sum": 1
    }
  }
}

Document.objects.aggregate(*pipeline)
0

All Articles