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

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

    The fastest way is db.collection.copyTo().

    Note that it is deprecated since version 3.0.

提交回复
热议问题