Home > git-documentdb > Collection > insertFatDoc
Collection.insertFatDoc() method#
Insert a data
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| shortName | string | undefined | null | shortName is a file path whose collectionPath is omitted. shortName of JsonDoc must ends with extension. |
| doc | JsonDoc | string | Uint8Array | |
| options | PutOptions |
Promise<PutResult >
Remarks#
Throws SameIdExistsError when data that has the same _id exists. It might be better to use put() instead of insert().
The saved file path is
${GitDocumentDB#workingDir}/${Collection#collectionPath}/${shortName}${extension}.If shortName is undefined, it is automatically generated.
_id property of a JsonDoc is automatically set or overwritten by shortName parameter whose extension is omitted.
Exceptions#
# Errors from validateDocument, validateId
# Errors from putWorker