重命名集合
> show collections
tianyc_test9
> db.runCommand({'renameCollection':'Gps.tianyc_test9', 'to':'Gps.tianyc_test99'})
{ "ok" : 1 }
> show collections
tianyc_test99
另:通过db.listCommands(),可以查看到所有mongo的命令。
本文介绍了如何使用MongoDB命令来重命名集合,并展示了具体的命令示例。此外还提供了查看所有Mongo命令的方法。
重命名集合
> show collections
tianyc_test9
> db.runCommand({'renameCollection':'Gps.tianyc_test9', 'to':'Gps.tianyc_test99'})
{ "ok" : 1 }
> show collections
tianyc_test99
另:通过db.listCommands(),可以查看到所有mongo的命令。
3037
1945

被折叠的 条评论
为什么被折叠?