Home > git-documentdb > GitDocumentDB > update
#
GitDocumentDB.update() methodUpdate a JSON document
Signature:#
ParametersParameter | Type | Description |
---|---|---|
jsonDoc | JsonDoc | JsonDoc whose _id is shortId. shortId is a file path whose collectionPath and extension are omitted. |
options | PutOptions |
Promise<PutResultJsonDoc >
#
RemarksThrows DocumentNotFoundError if a specified document does not exist. It might be better to use put() instead of update().
If _id is undefined, it is automatically generated.
The saved file path is
${GitDocumentDB#workingDir}/${_id}extension
on the file system.This is an alias of GitDocumentDB#rootCollection.update()
#
Exceptions# Errors from validateDocument, validateId
# Errors from putWorker