Oops.
I use mongoose, and accidentally created a collection "stats". I didn't realize this was going to be an issue until a few weeks later, so I now need to rename (rather than just delete) the collection...
However, my attempts have hit a predictable problem:
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
Try
db["stats"].find()
and
db["stats"].renameCollection('statssnapshots').
You could also do
db.getCollection("stats").find().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With