MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Document count showing zero despite documents existing in secondary

I have a MongoDB replica set with 6 members. 3 members (including the primary) are using MongoDB 3.4 and remaining 3 are MongoDB 3.6 which i have added as part of upgrading.

For 2 collections documents have been replicated to new secondary (version 3.6) but when I query document count is zero . Remaining collections are replicated to secondary without any issues.

I’m not sure why document count displays zero for these two collections.

https://i.stack.imgur.com/ZymaT.png

Hi,

This issue sounds unusual, but I wouldn’t recommend running mixed major releases for an extended period of time beyond validating your upgrade.

It has been some time since you posted this question - were you able to find a solution? If you are still running mixed versions, what specific version(s) of MongoDB 3.4 are you using?

One possibility is that the collection metadata (count & size stats) is somehow incorrect. Usually this happens after an unexpected shutdown, but you could try to run validate on affected collections to see if this corrects your issue.

Regards,
Stennie

1 Like