Skip to main content

Home > git-documentdb > Collection > updateFatDoc

Collection.updateFatDoc() method#

Update a data

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

Parameters#

ParameterTypeDescription
shortNamestring | undefined | nullshortName is a file path whose collectionPath is omitted. shortName of JsonDoc must ends with extension.
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}/${Collection#collectionPath}/${shortName}${extension} .

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

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

Exceptions#

Err.InvalidJsonObjectError

Err.DatabaseClosingError

Err.TaskCancelError

# Errors from validateDocument, validateId

# Errors from putWorker