Our database is currently running and everything seems to fine. I wanted to do some statistics so I did some standard calls. Basically I wanted the number of some specific data.
First some basic calls to show you that there actually is data in the database.
> db.files.count()
814639
> db.files.find({"migrated":true})
{ "migrated" : true, "filename" : "bleh",... }
...
So clearly there's data, and the call returns it. Now I want to find out how many results there is, but I get this:
> db.files.count({"migrated":true})
0
And I did this too:
> db.files.find({"migrated":true}).count()
0
Is there anyone who has any idea why this could be happening?
The versions is:
> db.version()
1.8.1
Any help would be much appreciated
It's probable that this question is related to the following bugs:
In my case (mongodb 2.0.1) was related to database corruption. See find().count() bug?
Been a while, but I'm closing this now. But it was a corrupt database. Had to manually move all the items from one database to a new one since a backup stopped when it found the corrupt data, and valid data afterwards wasn't being backed up.
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