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 enables interaction with a Couchbase database, specifically allowing users to execute SQL++ queries on documents stored within Couchbase buckets and scopes. The "Query" operation under the "Document" resource lets you run arbitrary N1QL (SQL++) queries against your Couchbase data.

Common scenarios where this node is beneficial include:

  • Retrieving filtered or aggregated data from Couchbase using custom queries.
  • Running complex queries that cannot be achieved through simple key-value operations.
  • Integrating Couchbase query results into automated workflows for reporting, analytics, or further processing.

For example, you could use this node to run a query like SELECT * FROM users WHERE name="Michael" to fetch all user documents with the name Michael.

Properties

Name Meaning
Couchbase Bucket Optional selection of the Couchbase bucket to query. Can be chosen from a list or entered by name.
Couchbase Scope Optional selection of the Couchbase scope within the bucket. Can be chosen from a list or entered by name.
Run Query The SQL++ query string to execute against the selected bucket and scope. Example: SELECT * FROM users WHERE name="Michael"

Output

The output is a JSON array representing the rows returned by the executed query. Each element corresponds to a row in the query result set, structured as an object with fields matching the queried document properties.

If no results are found, the output will contain a single object with a message indicating "No results found".

The node does not output binary data for this operation.

Dependencies

  • Requires a valid connection to a Couchbase cluster, authenticated via credentials including connection string, username, and password.
  • The node uses the official Couchbase Node.js SDK to connect and execute queries.
  • Proper configuration of the Couchbase cluster and availability of the specified bucket and scope is necessary.
  • The node expects the Couchbase cluster to support SQL++ queries (N1QL).

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 cluster is accessible.
  • Bucket or Scope Not Found: If the specified bucket or scope does not exist, the node will throw an error. Ensure the bucket and scope names are correct and exist in the cluster.
  • Invalid Query Syntax: Malformed SQL++ queries will cause errors. Validate your query syntax before running.
  • Empty Results: If the query returns no rows, the output will indicate "No results found". This is not an error but means the query matched no documents.
  • Timeouts: Network issues or slow queries may cause timeouts. Optimize queries or check network connectivity if timeouts occur.

Links and References

Discussion