{
"_id" : ObjectId("59660d4099c1e682e0992ced"),
"alpha" : [
{
"_id" : ObjectId("59660d4199c1e682e0992cee"),
"number" : 1,
"start_at" : ISODate("2017-07-12T11:51:28.895Z"),
"end_at" : ISODate("2017-08-12T11:51:28.895Z"),
"created_at" : ISODate("2017-07-12T11:51:29.346Z"),
"updated_at" : null
}
]
}
I have a document as stated above and I would like to update or change the 'number' and 'updated_at' field in the JSON element from the alpha array.
I tried this:
db.mycol.update({_id: ObjectId("59660d4099c1e682e0992ced"), alpha: {$elemMatch: {_id: ObjectId("59660d4199c1e682e0992cee")}}}, {$set: {"alpha.$.number": 2, "alpha.$.updated_at": new Date()}})
It works fine with a regular mongodb server. But with azure cosmosdb / mongodb, he speaks normally, but doesnβt actually update the document. What am I doing wrong?
source
share