prorm API Reference
    Preparing search index...

    Class PouchdbStore

    PouchdbStore wraps a pouchdb database and exposes both a common KV surface — put/get/del keyed on _id, batch, list — and PouchDB's native insert/allDocs operations.

    Implements

    Index
    name: "pouchdb" = 'pouchdb'

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

    library: "pouchdb" = 'pouchdb'

    The client library being used

    • Writes a document keyed by _id = key (PouchDB put), merging key in as its _id.

      Parameters

      • key: string
      • value: Record<string, unknown>

      Returns Promise<PouchWriteResult>

    • Native insert: stores a document as-is (must carry its own _id).

      Parameters

      • doc: PouchDoc

      Returns Promise<PouchWriteResult>

    • Reads a document by _id (PouchDB get).

      Parameters

      • key: string

      Returns Promise<PouchDoc>

    • Deletes a document by _id. PouchDB needs the current _rev to delete, so this first gets the document, then removes it.

      Parameters

      • key: string

      Returns Promise<PouchWriteResult>

    • Applies a list of put/del operations. Puts go through bulkDocs; deletes are resolved individually.

      Parameters

      • ops: PouchBatchOp[]

      Returns Promise<void>

    • Lists document ids via allDocs. With prefix, restricts to ids >= prefix and <= prefix + '￿' (PouchDB's startkey/endkey range).

      Parameters

      • Optionalprefix: string

      Returns Promise<string[]>