mongoose difference of findOneAndUpdate and update

后端 未结 3 1551
轻奢々
轻奢々 2020-12-15 03:11

What is difference of findOneAndUpdate and update? Both accept criteria to query and doc to update.

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 03:47

    Note there is an option returnNewDocument in the findOneAndXXX methods and it's default value is true. If you are using the node.js driver, the options is called returnOriginal.

提交回复
热议问题