|
asya can the invalid hint result in incorrect query results? I ran a simple test which suggested that this behavior does not trivially result in incorrect results:
MongoDB Enterprise > db.c.createIndex({a: 1}, {collation: {locale: "en_US", strength: 2}})
|
{
|
"createdCollectionAutomatically" : false,
|
"numIndexesBefore" : 1,
|
"numIndexesAfter" : 2,
|
"commitQuorum" : 1,
|
"ok" : 1
|
}
|
MongoDB Enterprise > db.c.insert({a: "FOO"})
|
WriteResult({ "nInserted" : 1 })
|
MongoDB Enterprise > db.c.find({a: "foo"}).hint({a: 1})
|
// No results.
|
MongoDB Enterprise > db.c.find({a: "foo"}).hint({a: 1}).explain()
|
{
|
"queryPlanner" : {
|
"plannerVersion" : 1,
|
"namespace" : "test.c",
|
"indexFilterSet" : false,
|
"parsedQuery" : {
|
"a" : {
|
"$eq" : "foo"
|
}
|
},
|
"queryHash" : "4B53BE76",
|
"planCacheKey" : "E4BB1AED",
|
"winningPlan" : {
|
"stage" : "FETCH",
|
"filter" : {
|
"a" : {
|
"$eq" : "foo"
|
}
|
},
|
"inputStage" : {
|
"stage" : "IXSCAN",
|
"keyPattern" : {
|
"a" : 1
|
},
|
"indexName" : "a_1",
|
"collation" : {
|
"locale" : "en_US",
|
"caseLevel" : false,
|
"caseFirst" : "off",
|
"strength" : 2,
|
"numericOrdering" : false,
|
"alternate" : "non-ignorable",
|
"maxVariable" : "punct",
|
"normalization" : false,
|
"backwards" : false,
|
"version" : "57.1"
|
},
|
"isMultiKey" : true,
|
"multiKeyPaths" : {
|
"a" : [
|
"a"
|
]
|
},
|
"isUnique" : false,
|
"isSparse" : false,
|
"isPartial" : false,
|
"indexVersion" : 2,
|
"direction" : "forward",
|
"indexBounds" : {
|
"a" : [
|
"[MinKey, MaxKey]"
|
]
|
}
|
}
|
},
|
"rejectedPlans" : [ ]
|
},
|
"serverInfo" : {
|
"host" : "storchbox",
|
"port" : 27017,
|
"version" : "0.0.0",
|
"gitVersion" : "unknown"
|
},
|
"ok" : 1
|
}
|
Therefore, I'm changing the issue type from "Bug" to "Improvement".
|