Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mongoose save or update

// This will create another document if it doesn't exist
findByIdAndUpdate(_id, { something: 'updated' }, { upsert: true });
 
PREVIOUS NEXT
Tagged: #mongoose #save #update
ADD COMMENT
Topic
Name
5+9 =