I have researched the aggregate framework of mongodb 2.1. And I have done a test.
var drugstore = {
id: 860011001238937,
name: "store1",
transaction_flow: [
{
pepdate: 20120327,
create_date: "2012-3-27 16:36:33",
trace: "000256",
peopleid: "123456",
tranamt: 1000,
},
{
pepdate: 20120405,
create_date: "2012-3-27 16:36:33",
trace: "000256",
peopleid: "123456",
tranamt: 1000,
}
]
};
after I inserted 40 thousand datas into transaction_flow, the mongodb is crashed. And I know the limit size of mongodb's document is 16Mb, now the drugstore collection is 22Mb. So the aggregate commands, ex. unwind, why design this command, and when to use?
The maximum size to any result of MongoDB commands is limited to 64MB. There is an ongoing ticket that will add an out option similar to the map reduce command where you can potentially dump the result into a new collection.
inline
output. If you are trying to return more than 16Mb of manipulated results, you would want to use Map/Reduce with output to a collection - Stennie 2012-09-19 01:23