prorm API Reference
    Preparing search index...

    Class ProvendbStore

    ProvendbStore wraps ProvenDB's HTTP proof/document API behind the shared ledger surface.

    Implements

    Index
    name: "provendb" = 'provendb'

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

    library: "fetch" = 'fetch'

    The client library being used

    • Insert data into collection at a new version (POST /collections/<c>/documents). Returns the inserted document (including its _id and _version).

      Parameters

      • collection: string
      • data: Record<string, unknown>

      Returns Promise<unknown>

    • Read the current version of document id from collection.

      Parameters

      • collection: string
      • id: string

      Returns Promise<unknown>

    • Return every version of document id (GET .../documents/<id>/versions).

      Parameters

      • collection: string
      • id: string

      Returns Promise<unknown>

    • Request a cryptographic proof for document id (POST .../documents/<id>/proof). The returned object contains the Merkle proof and the public-blockchain anchor that tamper-proofs the document's state at its version.

      Parameters

      • collection: string
      • id: string

      Returns Promise<unknown>

    • Run a Mongo-style filter query against collection (POST /collections/<c>/query). query is the Mongo filter document; options carries projection/sort/limit and an optional historical version.

      Parameters

      • collection: string
      • query: Record<string, unknown> = {}
      • Optionaloptions: Record<string, unknown>

      Returns Promise<unknown>

    • Fetch every document in collection matching the ORM where clause. The where is compiled to a MongoDB filter; attributes/order/limit/ offset become the projection/sort/limit/skip query options, and version (if given) reads the collection at a historical ProvenDB version.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • collection: string
      • options: ProvendbFindOptions = {}

      Returns Promise<T[]>

    • Fetch the first document matching where (Mongo limit 1), or null.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • collection: string
      • options: ProvendbFindOptions = {}

      Returns Promise<T | null>

    • Count documents in collection matching where.

      Parameters

      • collection: string
      • Optionalwhere: Record<string, any>

      Returns Promise<number>

    • Insert data as a new versioned document. Alias of append.

      Parameters

      • collection: string
      • data: Record<string, unknown>

      Returns Promise<unknown>

    • Insert many documents (one versioned write per document), returning them.

      Parameters

      • collection: string
      • docs: Record<string, unknown>[]

      Returns Promise<unknown[]>

    • Update every document matching where, $setting each key in values. Returns the raw ProvenDB response (which records the new version the write was captured at).

      Parameters

      • collection: string
      • values: Record<string, unknown>
      • Optionalwhere: Record<string, any>
      • options: { upsert?: boolean } = {}

      Returns Promise<unknown>

    • Insert-or-update: update documents matching where with data, creating a new document if none match (upsert: true).

      Parameters

      • collection: string
      • data: Record<string, unknown>
      • where: Record<string, any>

      Returns Promise<unknown>

    • Delete every document matching where. ProvenDB retains prior versions, so deleted documents remain recoverable via history.

      Parameters

      • collection: string
      • Optionalwhere: Record<string, any>

      Returns Promise<unknown>