I watched the video Getting Started with GDELT MongoDB, in it they create in MongoDB Compass an Aggregation called EventsGroupedBySource, I also do the same but using the data from my own cluster and works ok.
I tried to replicate in my code Node.js the same:
const newsWithAggregationBySourceUrl = await collection.aggregate([{$group:{
_id: “$SOURCEURL”,
count: {
$sum: 1
},
ids: {
$push: { id: “$_id”, code: “$EventCode”}
}
}}, {
“count”: { $gt: 1}
}]).toArray();
But I got the following error:
MongoServerError: count is not allowed in this atlas tier
Why I am able to create the Aggregation in MongoDB Compass but not in my code?
Is there an alternative to perform this query?
Thanks