好的,关于 document.save() 回调参数的 mongoose API 在哪里?

Ok, Where is mongoose API about document.save() callback argument?

英语不是我的第一语言,但我正在努力。

问题是我正在使用一个使用Mongoose的项目,但是我在document.save中找不到回调函数的参数的描述( ).

  1. Official Doc

link对我的问题给出了准确的回答,link的高人回答说回调参数里面有3个东西,但是我找不到官方文档的任何地方都有这样的解释,不只是一个选项参数,回调参数

但是在官方文档中是这样解释的

我是傻子吗?我想快速消除这个可悲的问题。帮助我,比尔·盖茨。

关于如何执行查询的指南mentions the following:

All callbacks in Mongoose use the pattern: callback(error, result). If an error occurs executing the query, the error parameter will contain an error document, and result will be null. If the query is successful, the error parameter will be null, and the result will be populated with the results of the query.

由于 Document.prototype.save() 的文档仅说明:

[fn] «Function» optional callback

所以你知道这个函数也不例外。因此,doc.save((err, doc) => { }) 是回调的签名。