db.photos.update({_id:"1587050015794"},{$set:{image:"image.link"}})
db.photos.update({"_id" : "1587050015794","albums._id": "1587050121637"},{$set: {'albums.$':{image:"image.link"}}})
{
"_id" : "1587050015794",
"slug" : "1",
"description" : {
"fr" : "1",
"EN" : "1"
},
"albums" : [
...,
{
"_id" : "1587050121637",
"slug" : "11",
"description" : {
"fr" : "11",
"EN" : "11"
},
"gallery" : [ ]
},
...
}
db.photos.update(
{_id:"1587050015794"},
{ $push: {
albums: { slug: 6666666 }
}
)
Find more questions by tags MongoDB