Skip to main content

Home > git-documentdb > GitDocumentDB > getDocByOid

GitDocumentDB.getDocByOid() method#

Get a Doc which has specified oid

Signature:
getDocByOid(fileOid: string, docType?: DocType): Promise<Doc | undefined>;

Parameters#

ParameterTypeDescription
fileOidstringObject ID (SHA-1 hash) that represents a Git object. (See https://git-scm.com/docs/git-hash-object )
docTypeDocType
Returns:

Promise<Doc | undefined>

Remarks#

  • undefined if a specified oid does not exist.

  • This is an alias of GitDocumentDB#rootCollection.getDocByOid()

Exceptions#

Err.DatabaseClosingError

Err.InvalidJsonObjectError