Skip to main content

Home > git-documentdb > GitDocumentDB > insertFatDoc

GitDocumentDB.insertFatDoc() method#

Insert a data

Signature:
insertFatDoc(name: string | undefined | null, doc: JsonDoc | string | Uint8Array, options?: PutOptions): Promise<PutResult>;

Parameters#

ParameterTypeDescription
namestring | undefined | nullname is a file path.
docJsonDoc | string | Uint8Array
optionsPutOptions
Returns:

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#

Err.InvalidJsonObjectError

Err.DatabaseClosingError

Err.TaskCancelError

# Errors from validateDocument, validateId

# Errors from putWorker