Skip to main content

Home > git-documentdb > Collection > getDocByOid

Collection.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.

Exceptions#

Err.DatabaseClosingError

Err.InvalidJsonObjectError