<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/firestore](./firestore.md) &gt; [/](./firestore_.md) &gt; [documentId](./firestore_.documentid.md)

## documentId() function

Returns a special sentinel `FieldPath` to refer to the ID of a document. It can be used in queries to sort or filter by the document ID.

<b>Signature:</b>

```typescript
export declare function documentId(): FieldPath;
```
<b>Returns:</b>

[FieldPath](./firestore_.fieldpath.md)

