Top "Aggregation-framework" questions

The MongoDB Aggregation Framework provides a means to reshape and aggregate data in MongoDB 2.2+.

Project first item in an array to new field (MongoDB aggregation)

I am using Mongoose aggregation (MongoDB version 3.2). I have a field users which is an array. I want to $project …

mongodb mongoose aggregation-framework
Mongo error when using aggregation: sort exceeded memory limit

I get the mongo error exceeded memory limit with error code 16819 when I use aggregation sort. Im using mongo 2.6. The …

mongodb aggregation-framework memory-limit
mongodb multiple match conditions and return documents with common name

below data is present in "examSheet" collection {"name":"a1", "std":"9", "year":"2017", "exam":"halfyr_T", "marks":[{"p":"45","m":"40","c":"50"}]} {"name":"a1", "…

mongodb match aggregation-framework multiple-conditions
Does MongoDB's $in clause guarantee order

When using MongoDB's $in clause, does the order of the returned documents always correspond to the order of the array …

mongodb mongoose mapreduce mongodb-query aggregation-framework
Mongo find duplicates for entries for two or more fields

I have documents like this: { "_id" : ObjectId("557eaf444ba222d545c3dffc"), "foreing" : ObjectId("538726124ba2222c0c0248ae"), "value" : "test", } …

mongodb mongodb-query aggregation-framework
MongoDB : querying documents with two equal fields, $match and $eq

What is the best way to return all documents in a collection if I want document.a == document.b? I've …

node.js mongodb npm aggregation-framework database
Get first element in array and return using Aggregate?

How can I get and return the first element in an array using a Mongo aggregation? I tried using this …

mongodb mongodb-query aggregation-framework
Obtaining $group result with group count

Assuming I have a collection called "posts" (in reality it is a more complex collection, posts is too simple) with …

mongodb mongodb-query aggregation-framework
MongoDB Projection of Nested Arrays

I've got a collection "accounts" which contains documents similar to this structure: { "email" : "[email protected]", "groups" : [ { "name" : "group1", "…

mongodb mongodb-query aggregation-framework
Poor lookup aggregation performance

I have two collections Posts: { "_Id": "1", "_PostTypeId": "1", "_AcceptedAnswerId": "192", "_CreationDate": "2012-02-08T20:02:48.790", "_Score": "10", ... "_OwnerUserId": "6", ... }, ... and users: { "_Id": "1", "_Reputation": "101", "_CreationDate": "2012-02…

mongodb aggregation-framework