Anywhere a callback is passed to a query in Mongoose, the callback follows the pattern callback(error, results). What results is depends on the operation: For findOne() it is a potentially-null single document, find() a list of documents, count() the number of documents, update() the number of documents affected, etc. The API docs for Models provide more detail on what is passed to the callbacks.
好好查文档应该能找到。我不使用mongoose驱动因此对它并不是十分熟悉,以下信息仅供参考:
http://mongoosejs.com/docs/qu...
看文档
用TypeScript:
mongsoose的官方文档还是蛮清晰的啊,你可以参考官方文档。一般查询语句的话回调函数是error和document两个属性。每一个模块的内部实现在官方文档都是能看到的,所以想知道传入几个参数然后不同参数的处理情况都是很好查看的。