Couchbase icon

Couchbase

Couchbase node to insert, update, retrieve, and delete data from a Couchbase database using KV, Query and Search services

Actions7

Overview

This node provides integration with a Couchbase database, allowing users to perform various operations on documents stored within Couchbase buckets, scopes, and collections. Specifically for the Document - Delete operation, it deletes a document identified by its Document ID from a specified Couchbase bucket, scope, and collection.

Common scenarios where this node is beneficial include:

  • Removing outdated or irrelevant documents from a Couchbase database.
  • Automating cleanup tasks in data pipelines.
  • Managing lifecycle of documents in applications that use Couchbase as their backend.

For example, if you have a document representing a user session or temporary cache entry, you can use this node to delete that document once it expires or is no longer needed.

Properties

Name Meaning
Couchbase Bucket The target Couchbase bucket where the document resides. You can select from a list or specify the bucket name directly.
Couchbase Scope The scope within the selected bucket to use. Select from a list or specify the scope name.
Couchbase Collection The collection inside the scope where the document is stored. Select from a list or specify the collection name.
Document ID The unique identifier of the document to delete. This is required to specify which document to remove.

Output

The output JSON contains an array with one object per processed item. For the delete operation, each object includes:

  • id: The Document ID that was deleted.
  • value: The result returned by the Couchbase SDK's remove method (usually metadata about the deletion).

Example output JSON snippet:

[
  {
    "id": "my-document-ID",
    "value": {
      // metadata about the deletion operation
    }
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires a valid connection to a Couchbase cluster using credentials that include:
    • Connection string (e.g., Couchbase server URL)
    • Username
    • Password
  • The node uses the official Couchbase Node.js SDK to connect and perform operations.
  • The node expects the Couchbase bucket, scope, and collection to exist prior to execution.
  • n8n must be configured with an API key credential or equivalent authentication token for Couchbase access.

Troubleshooting

  • Connection errors: If the node cannot connect to the Couchbase cluster, verify that the connection string, username, and password are correct, and that the Couchbase server is reachable.
  • Bucket/Scope/Collection not found: Ensure the specified bucket, scope, and collection exist in the Couchbase cluster. Selecting them from the provided lists helps avoid typos.
  • Document not found: Deleting a non-existent document may throw an error. Confirm the Document ID is correct.
  • Timeouts: Network issues or slow responses from Couchbase might cause timeouts. Check network connectivity and Couchbase server health.
  • Permission issues: The credentials used must have sufficient permissions to delete documents in the specified collection.

Common error messages:

  • "Could not connect to database: ..." — indicates connection or authentication failure.
  • "Please select a bucket." or "Scope 'X' not found in bucket 'Y'." — indicates missing or incorrect resource selection.
  • Errors thrown by the Couchbase SDK during removal usually indicate invalid Document IDs or permission problems.

Links and References

Discussion