Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose push items to array

people: {
         name: String, 
         friends: [{firstName: String, lastName: String}]
        }

db.people.update({name: "John"}, {$push: {friends: {firstName: "Harry", lastName: "Potter"}}});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mongoose #push #items #array
ADD COMMENT
Topic
Name
5+3 =