MongoDB klagar eftersom du har en okänd pipeline-stegsspecifikation "count":{ "$sum":1 }
i din pipeline.
Din ursprungliga pipeline när den är korrekt formaterad
db.hashtag.aggregate([
{
"$group": {
"_id": {
"year": { "$year": "$tweettime" },
"dayOfYear": { "$dayOfYear": "$tweettime" },
"interval": {
"$subtract": [
{ "$minute": "$tweettime" },
{ "$mod": [{ "$minute": "$tweettime"}, 15] }
]
}
}
},
"count": { "$sum": 1 } /* unrecognised pipeline specification here */
}
])
bör ha den samlade ackumulatorn $ summa
inom $group
pipeline som:
{
"$group": {
"_id": {
"year": { "$year": "$tweettime" },
"dayOfYear": { "$dayOfYear": "$tweettime" },
"interval": {
"$subtract": [
{ "$minute": "$tweettime" },
{ "$mod": [{ "$minute": "$tweettime"}, 15] }
]
}
},
"count": { "$sum": 1 }
}
}
])