Home > git-documentdb > GitDocumentDB > update
GitDocumentDB.update() method#
Update a JSON document
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| _id | string | undefined | null | _id is a file path whose extension is omitted. |
| jsonDoc | JsonDoc | |
| options | PutOptions |
Promise<PutResultJsonDoc >
Remarks#
Throws DocumentNotFoundError if a specified document does not exist. It might be better to use put() instead of update().
The saved file path is
${GitDocumentDB#workingDir}/${_id}extensionon the file system.An update operation is not skipped even if no change occurred on a specified document.
This is an alias of GitDocumentDB#rootCollection.update()
Exceptions#
# Errors from validateDocument, validateId
# Errors from putWorker