I have the following documents
{ _id:"myId", balance:1 }
and I want to change the field in number type to an array with the same number.
{ _id:"myId", balance: [1], }
tried
Collection.updateMany({ balance: { $type: 'number' } }, { $set: { balance: ["$balance"] } });
, didn't work ($balance string). How can i do this?