prorm API Reference
    Preparing search index...

    Class CouchbaseStore

    CouchbaseStore wraps the official couchbase SDK's Cluster/Bucket/Collection API in a small key/value CRUD plus N1QL convenience layer.

    Implements

    Index
    name: "couchbase" = 'couchbase'

    The name of the store (e.g. 'mongodb', 'redis', 'dynamodb')

    library: "couchbase" = 'couchbase'

    The client library being used

    • Resolves a collection handle. With no arguments (or only a bucket) it uses the store's configured defaults; passing an explicit scope/collection targets a non-default collection via bucket.scope(scope).collection(collection), otherwise it falls back to bucket.defaultCollection().

      Parameters

      • Optionalbucket: string
      • Optionalscope: string
      • Optionalcollection: string

      Returns any

    • Insert a new document; fails if the key already exists.

      Parameters

      • id: string
      • doc: unknown

      Returns Promise<unknown>

    • Insert or replace a document by key.

      Parameters

      • id: string
      • doc: unknown

      Returns Promise<unknown>

    • Fetch a document by key, returning its .content (the stored value).

      Parameters

      • id: string

      Returns Promise<unknown>

    • Replace an existing document; fails if the key does not exist.

      Parameters

      • id: string
      • doc: unknown

      Returns Promise<unknown>

    • Remove a document by key.

      Parameters

      • id: string

      Returns Promise<unknown>

    • Run a N1QL/SQL++ statement against the cluster and return its result rows. options.parameters binds positional (array) or named (object) parameters into the statement.

      Parameters

      • statement: string
      • options: CouchbaseQueryOptions = {}

      Returns Promise<unknown[]>