mongoDB 2.2.1 - database not valid

2020-04-17 03:27发布

问题:

When I run db.users.validate(); in the mongo terminal, I get the reply: { "errmsg" : "ns not found", "ok" : 0, "valid" : false }.

Is this normal? How can I solve it, since mongod --repair and db.repairDatabase() won't help?

Using Ubuntu 12.04 LTS x64, mongoDB x86_64 2.2.1 (clean new install)

回答1:

I think there is no collection with such name in database. If you try to do this in new database you will get the same error.