Change Intelligence is coming.

Couchbase insertDocuments

Last updated: July 13, 2026

Inserts one or more documents into a Couchbase collection, failing if any document key already exists. Documents may be specified inline or loaded from a file.

Known limitations:

  • Fails if any document key already exists. Use upsertDocuments to insert or overwrite existing documents.

  • There is no automatic rollback support.

Available attributes

You must specify all top-level attributes marked as required. If you specify an optional attribute, you must also specify any nested attributes that it requires.

Attribute

Type

Description

Required

bucketName

String

The name of the bucket containing the collection.

Yes

scopeName

String

The name of the scope containing the collection.

Yes

collectionName

String

The name of the collection to insert documents into.

Yes

document / documents

Element

One or more inline documents to insert. Mutually exclusive with importFile. See nested tags below.

Yes*

importFile

Element

A file reference for bulk document import. Mutually exclusive with document. See nested tags below.

Yes*

Nested tags — document

Attribute

Type

Description

Required

id

String

The unique document key.

Yes

value

Element

The document data. Contains data (String) and type (String). See nested tags below.

Yes

Nested tags — value (within document)

Attribute

Type

Description

Required

data

String

The document content as a string, formatted according to the specified type.

Yes

type

String

The data type of data. Json is a JSON object. String is a plain string. Long is an integer. Double is a floating-point number. Boolean is a boolean. JsonArray is a JSON array.

Yes

Nested tags — importFile

Attribute

Type

Description

Required

filePath

String

Path to the JSON file to import.

Yes

importType

String

How to read the file. LINES reads one JSON object per line. LIST reads a JSON array. SAMPLE reads sample documents. KEY_GENERATORS uses a custom key generator.

Yes

keyProviderType

String

How to generate document keys. DEFAULT uses an existing key field. UID generates a UUID. INCREMENT uses an auto-increment integer. EXPRESSION uses keyProviderExpression.

Yes

keyProviderExpression

String

Expression template for key generation. Required when keyProviderType is EXPRESSION.

No

loading

loading

loading