2. exec is the way of writing promise, replacing callback, and has the same effect as using callback.
For reference.
Love MongoDB! Have Fun!
-->Poke me<--Please poke me on the left, it’s April! Sign up now!
Registration for the MongoDB Chinese Community Shenzhen User Conference has begun! The master of this forum will make a grand appearance at the conference and deliver a speech. There is applause here! ! !
Please refer to Mongoose’s documentation
1. findOneAndUpdate([query], [doc], [options], [callback])
It will only be executed if callback is passed.
2. exec is the way of writing promise, replacing callback, and has the same effect as using callback.
For reference.
Love MongoDB! Have Fun!
-->Poke me<--Please poke me on the left, it’s April! Sign up now!
Registration for the MongoDB Chinese Community Shenzhen User Conference has begun! The master of this forum will make a grand appearance at the conference and deliver a speech. There is applause here! ! !