先通过mongo中的聚合函数:group()后返回的是DBObject 对象,我想将其存入另一个集合中,怎么办???
为情所困2017-04-24 16:01:32
Later, I figured it out myself, just put it directly into a document and insert it into the collection. .
習慣沉默2017-04-24 16:01:32
collection.aggregate([
{
'$match': {}
},
{
'$group': {}
}
], {
out: 'OtherCollection'
})
Requires MongoDB 2.6+
And every time you go out, the previous data will be erased
If you don’t want it to be erased, insert the structures into a new collection in batches