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

后端 未结 8 673
余生分开走
余生分开走 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:32

    In addition to AD7six 1st solution, if you use mongoexport / import be sure about your collection data types and mongo configuration, as explained here: http://docs.mongodb.org/manual/reference/mongodb-extended-json/

提交回复
热议问题