-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
ALL
-
QO 2023-11-27, QO 2023-12-11
The following query fails when it shouldn't (we should be able to handle an empty hint). Removing the hint field makes the command work as expected, and the command works in classic.
> db.adminCommand({setParameter: 1, internalQueryFrameworkControl: "forceBonsai"}) { "was" : "trySbeEngine", "ok" : 1 } > db.runCommand({aggregate: "test", pipeline: [{$match: {a: {$lt: 5}}}, {$project: {'a': 1}}], hint: {}, explain: true}) { "ok" : 0, "errmsg" : "Optimization failed either without tryBonsai set, or without a hint.", "code" : 7319401, "codeName" : "Location7319401" }
Looks like we need to add a check somewhere to handle this empty hint case.