|
When interrupting a count query (for example in the mongo shell with killOp()) there is no exception raised but 0 returned as the count result. The count query should also raise an exception instead of returning 0, what might be interpreted as a valid result.
I performed these queries in the mongo shell and killed them in another shell - You can see the difference between all three types of queries:
> db.messages.distinct({foo : "bar"})
|
Tue Aug 23 18:51:00 uncaught exception: distinct failed: { "errmsg" : "exception: interrupted", "code" : 11601, "ok" : 0 }
|
> db.messages.find({foo : "bar"})
|
error: { "$err" : "interrupted", "code" : 11601 }
|
> db.messages.count({foo : "bar"})
|
0
|
|