voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
27 lines (15 loc) • 873 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) > [get](./firestore_lite.documentsnapshot.get.md)
## DocumentSnapshot.get() method
Retrieves the field specified by `fieldPath`<!-- -->. Returns `undefined` if the document or field doesn't exist.
<b>Signature:</b>
```typescript
get(fieldPath: string | FieldPath): any;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| fieldPath | string \| [FieldPath](./firestore_lite.fieldpath.md) | The path (for example 'foo' or 'foo.bar') to a specific field. |
<b>Returns:</b>
any
The data at the specified field location or undefined if no such field exists in the document.