Incorrect Count returned by MongoDB (WiredTiger)

后端 未结 2 1644
情书的邮戳
情书的邮戳 2020-12-31 08:27

This sounds odd, and I hope I am doing something wrong, but my MongoDB collection is returning the Count off by one in my collection.

I hav

2条回答
  •  粉色の甜心
    2020-12-31 09:00

    According to this issue, this behaviour can occur if mongodb experiences a hard crash and is not shut down gracefully. If not issuing any query, mongodb probably just falls back to the collected statistics.

    According to the article, calling db.COLLECTION.validate(true) should reset the counters.

提交回复
热议问题