Home > git-documentdb > GitDocumentDB > insertFatDoc
GitDocumentDB.insertFatDoc() method#
Insert a data
Signature:Parameters#
| Parameter | Type | Description |
|---|---|---|
| name | string | undefined | null | name is a file path. |
| 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}/${name}extension.If a name parameter is undefined, it is automatically generated.
_id property of a JsonDoc is automatically set or overwritten by name parameter whose extension is omitted.
This is an alias of GitDocumentDB#rootCollection.insertFatDoc()
Exceptions#
# Errors from validateDocument, validateId
# Errors from putWorker