Details
-
Question
-
Resolution: Done
-
Major - P3
-
None
-
3.2.22
-
None
Description
While debugging a problem in an app I found that it is caused by a wrong value returned from Mongo. So I end up have a collection for which .count() always returns 136 while the collection is empty.
Here is what I see in the mongo terminal:
> db.ReadStats.findOne() — normal collection
|
null
|
> db.ReadStats.count()
|
0
|
> db.PendingRecords.findOne() — broken collection?
|
null
|
> db.PendingRecords.count()
|
136
|
When I do dump — this collection is saved as PendingRecords.bson 0 B file. So it is really empty. And according to our log of logic actions, it really should be empty.
> db.repairDatabase()
|
{ "ok" : 1 } |
> db.PendingRecords.count()
|
0
|
Repair helped, but what could go wrong? What should we do to do not encounter this again? Because it just breaks our app (