mongo-rename操作

重命名集合

> show collections
tianyc_test9
> db.runCommand({'renameCollection':'Gps.tianyc_test9', 'to':'Gps.tianyc_test99'})
{ "ok" : 1 }
> show collections
tianyc_test99

另:通过db.listCommands(),可以查看到所有mongo的命令。

posted @ 2013-02-06 16:20  醇酒醉影  阅读(1414)  评论(0编辑  收藏  举报