-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.4.2
-
Component/s: Index Maintenance
-
None
-
Query Execution
-
Query 2021-01-25, Query Execution 2021-02-22
db.collection.createIndex({ 'a.$**': 1 }) db.collection.insert({ a: { b: DBRef('1', '2') } }) db.collection.find({ 'a.b': DBRef('1', '2') }).hint('a.$**_1') db.collection.find({ 'a.b.$ref': '1', 'a.b.$id': '2' }).hint('a.$**_1')
The third line blows up with:
Error: error: { "ok" : 0, "errmsg" : "error processing query: ns=test.collectionTree: a.b $eq { $ref: \"1\", $id: \"2\" }\nSort: {}\nProj: {}\n planner returned error :: caused by :: $hint: refusing to build whole-index solution, because it's a wildcard index", "code" : 291, "codeName" : "NoQueryExecutionPlans" }
While the fourth one works fine. However, they mean the same thing so both should work.