<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md) &gt; [data](./firestore_.querydocumentsnapshot.data.md)

## QueryDocumentSnapshot.data() method

Retrieves all fields in the document as an `Object`<!-- -->.

By default, `FieldValue.serverTimestamp()` values that have not yet been set to their final value will be returned as `null`<!-- -->. You can override this by passing an options object.

<b>Signature:</b>

```typescript
/** @override */
data(options?: SnapshotOptions): T;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  options | [SnapshotOptions](./firestore_.snapshotoptions.md) | An options object to configure how data is retrieved from the snapshot (for example the desired behavior for server timestamps that have not yet been set to their final value). |

<b>Returns:</b>

T

An `Object` containing all fields in the document.

