Answer the question
In order to leave comments, you need to log in
How to update mongodb?
There is a tree structure
{
"red": {
"dynamic_field_time": {
"films": {
"title": "blabla",
"description": "blabla":
sessinons: [
"18:00",
"20:00"
]
}
},
...
}
}
db.get().collection('cinemaRooms').findOneAndUpdate(
{ [film.cinemaRoom]: {} },
{
$push: {
[film.date]: {}
}
},
{ new: true },
(err, docs) => {
cb(err, docs);
}
)
Answer the question
In order to leave comments, you need to log in
$push adds to the array, and you have *red* - an object, there cannot be duplicate keys in an object
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question