-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.43.6
-
Component/s: None
-
None
-
Environment:OS: Windows 11
-
2
-
Not Needed
-
Developer Tools
Problem Statement/Rationale
When trying to preview the update of a call with an agg pipeline defined using $map and $mergeObjects, the indexes from the original data array will show duplicate values, and the result may have also wrong values if the array has more than 10 elements. If you run the update code, the result seems to be correct (at least in the cases I have tried)
See screenshot for easier understanding
Steps to Reproduce
in any collection with a field that contains an array of objects, open update modal, use an array with the agreggation pipeline defining new fields with a $map like for example (in my case the array field is called eventDefaults)
[ { $set: { "eventDefaults": { $map: { input: "$eventDefaults", as: "elem", in: { $mergeObjects: [ "$$elem", { "newField": 1 } ] } } } } } ]
Expected Results
Preview shows the right indexes for existing and new data
Actual Results
wrong indexes (duplicated on original array and with strange values on the new one)