The MongoDB Aggregation Framework provides a means to reshape and aggregate data in MongoDB 2.2+.
1
vote
1answer
15 views
mongo aggregation framework get transactions in sequence
How do i do this in mongo aggregation framework?
given these records
record 1. {id:1,action:'clicked',user:'id', time:'1'}
record 2. {id:2,action:'video play',user:'id',time:'2'}
record 3. ...
0
votes
1answer
13 views
combing result of two queries
my collection is like
{ queid:"1', date:'07/24/2013', resolved:'true' }
i want to get counts like
{date:'07/24/2013',countquestion:10,resolved:5}
{date:'07/23/2013',countquestion:5,resolved:2}
...
0
votes
1answer
26 views
Array intersection in mongodb with Aggregation framework
I have a collection with schema (mongoose) say :
{
name : String,
age : Number,
params : [Number] // eg : params = [1,21,45,32,0] , usually they are very small arrays
}
The collection has ...
0
votes
2answers
23 views
mongodb aggregation framework groupby multiple fields
My collection is like
{queid:'1',date:'07023/2013',topic: 'topic1'}
{queid:'2',date:'07022/2013',topic: 'topic2'}
{queid:'3',date:'07022/2013',topic: 'topic1'}
{queid:'4',date:'07023/2013',topic: ...
0
votes
1answer
18 views
Mongo date aggregation operators with ObjectId
I'm trying to use the ObjectId as a creation date holder, and running into some problems when trying to do aggregation queries. In particular we want to use the date aggregation operators to group the ...
0
votes
1answer
10 views
Mongo - How can I aggregate, filter, and include an array of data from the matching documents?
I have a mongo-backed contact database going and I'm trying to find duplicate entries in a bunch of different ways.
For example, if 2 contacts have the same phone number they are flagged as a ...
0
votes
2answers
34 views
MongoDB Aggregation Multiple Keys
I trying to aggregate employees using department and status to calculate summ for each status. From this:
{
name : "Employee_1",
department: "hr",
status : "exist"
},
{
name : "Employee_2",
...
0
votes
1answer
35 views
How to sum every fields in a sub document of MongoDB?
I got a problem when I use db.collection.aggregate in MongoDB.
I have a data structure like:
_id:...
Segment:{
"S1":1,
"S2":5,
...
"Sn":10
}
It means the following in Segment: I might ...
0
votes
1answer
21 views
Group and take top K of each group with aggregation framwork
I have a MongoDB collection with documents in that format:
{ "_id":..., "Group": 1, "Value": 4 }
{ "_id":..., "Group": 2, "Value": 8 }
{ "_id":..., "Group": 1, "Value": 10 }
and so on...
Given X, ...
0
votes
1answer
41 views
MongoDB Java Driver: Aggregation using $match with multiple condition
I've been doing some search but haven't been able to find the answer. From docs, In mongo, if
$match: { type: "airfare"}
translated as:
DBObject match = new BasicDBObject("$match", new ...
0
votes
1answer
23 views
MongoDB aggregation of large amounts of data
I am doing aggregation on a really large amounts of data and I want to group this data by a date field. So I am doing a projection first so I can add this field:
$project: {
//include other fields
...
0
votes
1answer
29 views
mongo aggregation framework with distinct count of key with mutliple group by
I have reviewed several answers and examples relating to the above topic (including on SO), but couldn't find a working example to use answering my requirements:
I have a collection of documents ...
2
votes
1answer
21 views
Absolute value with MongoDB aggregation framework
I'm using the MongoDB aggregation framework and need to take the absolute value of an amount field, which I use in both the project portion and the group portion, ex:
'$project' => {
...
0
votes
1answer
38 views
How to read from List and Display in Jaspersoft iReport Designer 5.1 using MongoDB as a field
I have a MondoDB Collection 'quotes' with lineItems 'list'.. as shown below...
db.quotes.find();
> { "_id" : "51d31c4a0364a1b7f7cf45f7",
"accountName" : "NewAccountName",
"className" : ...
2
votes
2answers
147 views
Mongo DB - Sort and Skip within a group
I am using MongoDB and I want to sort and skip records within a group.
Below is a sample data:
{
"_id" : ObjectId("51cd7274267d959cb9f95cea"),
"creation_time" : 100,
"delivered" : true,
...