<!-- 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; [destroy](./git-documentdb.gitdocumentdb.destroy.md)

## GitDocumentDB.destroy() method

Destroy a database

<b>Signature:</b>

```typescript
destroy(options?: DatabaseCloseOption): Promise<{
        ok: true;
    }>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  options | [DatabaseCloseOption](./git-documentdb.databasecloseoption.md) | The options specify how to close database. |

<b>Returns:</b>

Promise&lt;{ ok: true; }&gt;

## Exceptions

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

[DatabaseCloseTimeoutError](./git-documentdb.databaseclosetimeouterror.md)

[FileRemoveTimeoutError](./git-documentdb.fileremovetimeouterror.md)

## Remarks

- [GitDocumentDB.close()](./git-documentdb.gitdocumentdb.close.md) is called automatically before destroying.

- options.force is true if undefined.

- The Git repository and the working directory are removed from the filesystem.

- local\_dir (which is specified in constructor) is not removed.

- destroy() can remove a database that has not been created yet if a working directory exists.

