-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 5.0.9, 4.4.15
-
Component/s: None
-
None
-
ALL
As we know proper way to access a array element in aggregation runtime is via using `$arrayElemAt` operator. but in situations which I have tried with invalid methods like `$$arr.0` or `$$arr.[0]` I expect to get some kind of error or maybe similar behaviour as using `$$arr[0]` which does nothing but except with two latter methods of accessing array element I would get an empty array as result which I consider to be some sort of bug or invalidAccessMethodWhichDoesSomethingWierd:something. Or... there is some unknown defined behaviour which I'm not aware of!
Currently I checked this with mongod version 4.4(for sure) and 5.0.9(I think so...) and result was the same.
As you see in the picture on right terminal I set with 3 methods which 2 of them are invalid but In those 2 invalid situations I get different responses. neither of them throws any error...
- related to
-
SERVER-27442 Positional path component in match language should not act as both an array index and a field name for a single document
- Backlog