-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
QE 2024-09-16
-
200
Create a collection with
db.test.insert({ "_id" : 0, "level" : 1});
and run the incorrect query (because "minN" expects the value to be a constant, not an expression)
db.test.aggregate( [{"$setWindowFields": {"sortBy": {"num": 1}, "output": {"my_out": {"$minN": {"n": "$level", "input": "$level1"}}}}}])
It will fail compilation with
uncaught exception: Error: command failed: { "ok" : 0, "errmsg" : "undefined slot accessor:1", "code" : 4946301, "codeName" : "Location4946301" }