Skip to main content

Home > git-documentdb > GitDocumentDB > updateFatDoc

GitDocumentDB.updateFatDoc() method#

Update a data

Signature:
updateFatDoc(name: string | undefined | null, doc: JsonDoc | string | Uint8Array, options?: PutOptions): Promise<PutResult>;

Parameters#

ParameterTypeDescription
namestring | undefined | nullname is a file path.
docJsonDoc | string | Uint8Array
optionsPutOptions
Returns:

Promise<PutResult >

Remarks#

  • Throws DocumentNotFoundError if a specified data does not exist. It might be better to use put() instead of update().

  • The saved file path is ${GitDocumentDB#workingDir}/${name}extension .

  • _id property of a JsonDoc is automatically set or overwritten by name parameter whose extension is omitted.

  • An update operation is not skipped even if no change occurred on a specified data.

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

Exceptions#

Err.InvalidJsonObjectError

Err.DatabaseClosingError

Err.TaskCancelError

# Errors from validateDocument, validateId

# Errors from putWorker