Home > @firebase/firestore > lite > DocumentSnapshot > get
DocumentSnapshot.get() method
Retrieves the field specified by fieldPath. Returns undefined if the document or field doesn't exist.
Signature:
get(fieldPath: string | FieldPath): any;
Parameters
| Parameter | Type | Description |
|---|---|---|
| fieldPath | string | FieldPath | The path (for example 'foo' or 'foo.bar') to a specific field. |
Returns:
any
The data at the specified field location or undefined if no such field exists in the document.