Home > git-documentdb > GitDocumentDB > put
GitDocumentDB.put() method#
Insert a JSON document if not exists. Otherwise, update it.
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| jsonDoc | JsonDoc | JsonDoc whose _id is shortId. shortId is a file path whose collectionPath and extension are omitted. |
| options | PutOptions |
Promise<PutResultJsonDoc >
Remarks#
The saved file path is
${GitDocumentDB#workingDir}/${jsonDoc._id}${extension}on the file system.If _id is undefined, it is automatically generated.
This is an alias of GitDocumentDB#rootCollection.put()
Exceptions#
# Errors from validateDocument, validateId
# Errors from putWorker