What's the fastest way to copy a collection within the same database?

后端 未结 8 674
余生分开走
余生分开走 2020-11-30 19:01

I want to copy a collection within the same database and give it a different name - basically take a snapshot.

What\'s the best way to do this? Is

8条回答
  •  伪装坚强ぢ
    2020-11-30 19:25

    You can use the copyDatabase function in the mongo shell:

    http://docs.mongodb.org/manual/tutorial/copy-databases-between-instances/

提交回复
热议问题