mongoose push to nested array on first position code example
Example: mongodb mongoose push into nested array
db.collection.updateOne(
{ "_id": ID, "playlists._id": "58"},
{ "$push":
{"playlists.$.musics":
{
"name": "test name",
"duration": "4.00"
}
}
}
)