voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
20 lines (11 loc) • 652 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [DocumentSnapshot](./firestore_lite.documentsnapshot.md) > [data](./firestore_lite.documentsnapshot.data.md)
## DocumentSnapshot.data() method
Retrieves all fields in the document as an `Object`<!-- -->. Returns `undefined` if the document doesn't exist.
<b>Signature:</b>
```typescript
data(): T | undefined;
```
<b>Returns:</b>
T \| undefined
An `Object` containing all fields in the document or `undefined` if the document doesn't exist.