-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.6.4
-
Component/s: Querying
-
None
-
ALL
-
Running a count with an invalid hint may or may not error.
1. If there are no documents in the collection it won't error
2. If there are documents but no filter it won't error
3. If there are documents and a filter it will error
collection = db.jstests_count_hint; collection.drop(); assert.throws( function() { collection.find( { i: 1 } ).hint( "BAD HINT" ).count(); }, [], "A"); assert.throws( function() { collection.find().hint( "BAD HINT" ).count(); }, [], "B"); collection.save({i: 1}); assert.throws( function() { collection.find({ i: 1 }).hint( "BAD HINT" ).count(); }, [], "C");
Only "C" will error.
- duplicates
-
SERVER-14792 count command with a bad index hint does not fail if the query is empty
- Closed