mongoose.findOneAndUpdate returns null [duplicate] mongoose.findOneAndUpdate returns null [duplicate] mongoose mongoose

mongoose.findOneAndUpdate returns null [duplicate]


See the documentation:http://mongoosejs.com/docs/api.html#query_Query-findOneAndUpdate

Available options

new: bool - if true, return the modified document rather than the original. defaults to false

[...]

Also, you can just check for err in your callback function.