Here's everything we announced at I/O, from new Firebase Studio features to more ways to integrate AI.
Read blog.
QueryDocumentSnapshot class
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
QueryDocumentSnapshot
包含從 Firestore 資料庫中文件讀取的資料,做為查詢的一部分。文件保證存在,且使用者可使用 .data()
或 .get(<field>)
擷取其資料,藉此取得特定欄位。
QueryDocumentSnapshot
提供與 DocumentSnapshot
相同的 API 介面。由於查詢結果只包含現有文件,因此 exists
屬性將一律為 true,data()
絕不會傳回「未定義」。
簽名:
export declare class QueryDocumentSnapshot<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> extends DocumentSnapshot<AppModelType, DbModelType>
擴充: DocumentSnapshot<AppModelType、DundModelType>
方法
方法 |
修飾符 |
說明 |
data() |
|
將文件中的所有欄位擷取為 Object 。 |
QueryDocumentSnapshot.data()
將文件中的所有欄位擷取為 Object
。
簽名:
/** @override */
data(): AppModelType;
傳回:
AppModelType
包含文件所有欄位的 Object
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-09 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-09 (世界標準時間)。"],[],[]]