I have a document with fields "MyElement" and "MyArray". I want to update my entire collection so that MyElement also appears as the initial item of MyArray.
I tried the following, but it did not work:
.updateMany({}, {$push:{MyArray:{$each:["$MyElement"],$position: 0}}})
This just pushed the string literal $MyElement, not the actual value. How do I refer to the actual value?