<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [git-documentdb](./git-documentdb.md) &gt; [GitDocumentDB](./git-documentdb.gitdocumentdb.md) &gt; [get](./git-documentdb.gitdocumentdb.get.md)

## GitDocumentDB.get() method

Get a document

<b>Signature:</b>

```typescript
get(docId: string, backNumber?: number): Promise<JsonDoc | undefined>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  docId | string | id of a target document |
|  backNumber | number | Specify a number to go back to old revision. Default is 0. When backNumber is 0, a document in the current DB is returned. When backNumber is 0 and a document has been deleted in the current DB, it returns undefined. |

<b>Returns:</b>

Promise&lt;[JsonDoc](./git-documentdb.jsondoc.md) \| undefined&gt;

- JsonDoc if exists.

- undefined if not exists.

## Exceptions

[DatabaseClosingError](./git-documentdb.databaseclosingerror.md)

[RepositoryNotOpenError](./git-documentdb.repositorynotopenerror.md)

[UndefinedDocumentIdError](./git-documentdb.undefineddocumentiderror.md)

[InvalidJsonObjectError](./git-documentdb.invalidjsonobjecterror.md)

[InvalidIdCharacterError](./git-documentdb.invalididcharactererror.md)

[InvalidIdLengthError](./git-documentdb.invalididlengtherror.md)

