Home > git-documentdb > Collection > put
#
Collection.put() methodInsert a JSON document if not exists. Otherwise, update it.
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 >
#
RemarksThe saved file path is
${GitDocumentDB#workingDir}/${Collection#collectionPath}${jsonDoc._id}${extension}
.If _id is undefined, it is automatically generated.
#
Exceptions# Errors from validateDocument, validateId
# Errors from putWorker