哎呀.
我使用mongoose,并意外地创建了一个集合"stats".直到几周后我才意识到这将成为一个问题,所以我现在需要重命名(而不是仅删除)该集合......
但是,我的尝试遇到了一个可预测的问题:
PRIMARY> db.stats.find();
Thu Oct 18 10:39:43 TypeError: db.stats.find is not a function (shell):1
PRIMARY> db.stats.renameCollection('statssnapshots');
Thu Oct 18 10:39:45 TypeError: db.stats.renameCollection is not a function (shell):1
Run Code Online (Sandbox Code Playgroud)
    Tad*_*all 16
尝试db ["stats"].find()和db ["stats"].renameCollection('statssnapshots').
你也可以做db.getCollection("stats").find().