MongoDB's count() incorrectly returns 0 if a query is given

后端 未结 2 1032
执笔经年
执笔经年 2021-01-03 02:01

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 d

2条回答
  •  醉话见心
    2021-01-03 02:42

    It's probable that this question is related to the following bugs:

    • Interrupted count query returns 0 as count result
    • count command returns zero in some error cases rather than reporting an error with ok:false

    In my case (mongodb 2.0.1) was related to database corruption. See find().count() bug?

提交回复
热议问题