Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongodb mongoose push into nested array

db.collection.updateOne(
    { "_id": ID, "playlists._id": "58"},
    { "$push": 
        {"playlists.$.musics": 
            {
                "name": "test name",
                "duration": "4.00"
            }
        }
    }
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongodb #mongoose #push #nested #array
ADD COMMENT
Topic
Name
2+8 =