开发者

mongodb, copy all documents to collection

开发者 https://www.devze.com 2023-03-27 20:17 出处:网络
collection_A is mapReduced result. If I want to save { \'11-8-12\' : collection_A} in collection_B. How can I save one 开发者_如何转开发collection to another collection, as one of elements?I don\'t

collection_A is mapReduced result.

If I want to save { '11-8-12' : collection_A} in collection_B.

How can I save one 开发者_如何转开发collection to another collection, as one of elements?


I don't think you can directly do that.

You have to manually build the document and save it to the database.

You can write this in JS and execute it with db.eval(...) so that data won't be transferred to the client, but this will convert integers to floats (the same problem you have with the mongodb shell).

0

精彩评论

暂无评论...
验证码 换一张
取 消