I have this mongo query
db.getCollection("users").updateMany({ _id: ObjectId('65d8fd25618ef79985233636') }, { $set: { questionAnswers: { hobbies: "$hobbies", islandItems: "$islandItems", superPower: "$superPower" }}})
I am trying to set variables that already exist on this user object to be inside of a new json object called questionAnswers, it works in the sense of it will create that object but the values are not copying over from the variables it is just setting it to a string that is legit the “$islandItems” with the dollar sign in it.
Any help is appreciated!
I have tried changing the quotes and everything to see if that helps. Im expecting that it fills the new variables with the old ones