data schema
ID: String,
Item: {
Possess: {
Jewel: [Number]
}
code
var temp = 1
db.collection.update({"ID":"sample"},{"$set":{"Item.Possess.Jewel.1":888})
How to use variable temp in "Item.Possess.Jewel.1" ?
"Item.Possess.Jewel.temp" doesn't work