15

おっとっと。

私はマングースを使用していますが、誤ってコレクション「統計」を作成しました。数週間後までこれが問題になるとは知らなかったので、コレクションの名前を変更する必要があります (単に削除するのではなく)...

しかし、私の試みは予測可能な問題にぶつかりました:

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
4

1 に答える 1

21

試す

db["stats"].find()

db["stats"].renameCollection('statssnapshots').

あなたもすることができます

db.getCollection("stats").find().
于 2012-10-18T17:51:25.037 に答える