Home > git-documentdb > GitDocumentDB > open
GitDocumentDB.open() method#
Open or create a Git repository
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| openOptions | OpenOptions |
Promise<DatabaseOpenResult >
Remarks#
Create a new Git repository if a dbName specified in the constructor does not exist.
GitDocumentDB creates a legitimate Git repository and unique metadata under '.gitddb/'.
'.gitddb/' keeps DatabaseInfo for combining databases, checking schema and migration.
GitDocumentDB can also load a Git repository that is created by other apps. It almost works; however, correct behavior is not guaranteed if it does not have a valid '.gitddb/'.
Exceptions#
Err.RepositoryNotFoundError may occurs when openOptions.createIfNotExists is false.
# Errors from _createRepository
# Errors from putWorker