-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 3.1.0
-
Component/s: None
-
Empty show more show less
This line:
https://github.com/mongodb/node-mongodb-native/blob/3.1/lib/operations/collection_ops.js#L237
will throw an error if the query to countDocuments does not match:
db.collection('somecollection').countDocuments({foo: 'blah'})
Uncaught TypeError: Cannot read property 'n' of undefined
`docs` is an empty array if the query does not match.