voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
33 lines (19 loc) • 1.22 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [doc](./firestore_lite.doc_2.md)
## doc() function
Gets a `DocumentReference` instance that refers to a document within `reference` at the specified relative path.
<b>Signature:</b>
```typescript
export declare function doc(reference: DocumentReference<unknown>, path: string, ...pathSegments: string[]): DocumentReference<DocumentData>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| reference | [DocumentReference](./firestore_lite.documentreference.md)<!-- --><unknown> | A reference to a Firestore document. |
| path | string | A slash-separated path to a document. |
| pathSegments | string\[\] | Additional path segments that will be applied relative to the first argument. |
<b>Returns:</b>
[DocumentReference](./firestore_lite.documentreference.md)<!-- --><[DocumentData](./firestore_lite.documentdata.md)<!-- -->>
The `DocumentReference` instance.
## Exceptions
If the final path has an odd number of segments and does not point to a document.