久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

node.js - 關于mongoose方法的回調(diào)函數(shù)的參數(shù)問題,如何知道參數(shù)個數(shù)以及參數(shù)代表什么含義呢?

瀏覽:118日期:2024-07-17 11:31:37

問題描述

mongoose中方法幾乎都有回調(diào)函數(shù),但是回調(diào)函數(shù)的參數(shù)信息查詢不到,所以請問如何可以查到呢?

問題解答

回答1:

好好查文檔應該能找到。我不使用mongoose驅動因此對它并不是十分熟悉,以下信息僅供參考:http://mongoosejs.com/docs/qu...

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.

回答2:

看文檔

用TypeScript:

node.js - 關于mongoose方法的回調(diào)函數(shù)的參數(shù)問題,如何知道參數(shù)個數(shù)以及參數(shù)代表什么含義呢?

回答3:

mongsoose的官方文檔還是蠻清晰的啊,你可以參考官方文檔。一般查詢語句的話回調(diào)函數(shù)是error和document兩個屬性。每一個模塊的內(nèi)部實現(xiàn)在官方文檔都是能看到的,所以想知道傳入幾個參數(shù)然后不同參數(shù)的處理情況都是很好查看的。

主站蜘蛛池模板: 麦盖提县| 前郭尔| 北海市| 临泉县| 治县。| 德昌县| 南溪县| 宝兴县| 奉新县| 河间市| 荔波县| 呼和浩特市| 信宜市| 乌拉特中旗| 新疆| 沈阳市| 湘潭市| 儋州市| 临洮县| 客服| 林口县| 商城县| 县级市| 沧州市| 巍山| 凉山| 北辰区| 丽江市| 佛坪县| 兴宁市| 南丰县| 阿勒泰市| 中超| 雷波县| 自贡市| 建昌县| 新津县| 河西区| 长泰县| 黔东| 晋江市|