Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

default values not applied on findoneandupdate mongoose

User.findOneAndUpdate({email: user.email}, user, {upsert: true, setDefaultsOnInsert:true}, ...)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #default #values #applied #findoneandupdate #mongoose
ADD COMMENT
Topic
Name
5+9 =