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>
확장: 문서스냅샷 <AppModelType, DbModelType>
행동 양식
방법 | 수정자 | 설명 |
---|---|---|
데이터() | 문서의 모든 필드를 Object 로 검색합니다. |
쿼리문서스냅샷.데이터()
문서의 모든 필드를 Object
로 검색합니다. .
서명:
/** @override */
data(): AppModelType;
보고:
앱모델 유형
문서의 모든 필드를 포함하는 Object
.