Type alias CollectionInsertOptions

CollectionInsertOptions: {
    mergeObjects?: boolean;
    overwriteMode?: "ignore" | "update" | "replace" | "conflict";
    refillIndexCaches?: boolean;
    returnNew?: boolean;
    returnOld?: boolean;
    silent?: boolean;
    versionAttribute?: string;
    waitForSync?: boolean;
}

Options for inserting a new document into a collection.

Type declaration

  • Optional mergeObjects?: boolean

    If set to false, object properties that already exist in the old document will be overwritten rather than merged when an existing document with the same _key or _id is updated. This does not affect arrays.

    Default: true

  • Optional overwriteMode?: "ignore" | "update" | "replace" | "conflict"

    Defines what should happen if a document with the same _key or _id already exists, instead of throwing an exception.

    Default: `"conflict"

  • Optional refillIndexCaches?: boolean

    If set to true, new entries will be added to in-memory index caches if document insertions affect the edge index or cache-enabled persistent indexes.

    Default: false

  • Optional returnNew?: boolean

    If set to true, the complete new document will be returned as the new property on the result object. Has no effect if silent is set to true.

    Default: false

  • Optional returnOld?: boolean

    If set to true, the complete old document will be returned as the old property on the result object. Has no effect if silent is set to true. This option is only available when overwriteMode is set to "update" or "replace".

    Default: false

  • Optional silent?: boolean

    If set to true, no data will be returned by the server. This option can be used to reduce network traffic.

    Default: false

  • Optional versionAttribute?: string

    If set, the attribute with the name specified by the option is looked up in the stored document and the attribute value is compared numerically to the value of the versioning attribute in the supplied document that is supposed to update/replace it.

  • Optional waitForSync?: boolean

    If set to true, data will be synchronized to disk before returning.

    Default: false