prorm API Reference
    Preparing search index...

    Class NedbStore

    NedbStore wraps a nedb Datastore and exposes both a common KV surface — put/get/del keyed on _id, batch, list — and NeDB's native document operations insert/find.

    Implements

    Index
    name: "nedb" = 'nedb'

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

    library: "nedb" = 'nedb'

    The client library being used

    • Writes a document keyed by _id = key. Maps onto NeDB's insert, merging key into the document as its _id.

      Parameters

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

      Returns Promise<NedbDoc>

    • Reads a document by _id (NeDB findOne({ _id })). Returns null if absent.

      Parameters

      • key: string

      Returns Promise<NedbDoc | null>

    • Deletes a document by _id (NeDB remove({ _id })). Returns the number removed.

      Parameters

      • key: string

      Returns Promise<number>

    • Native insert: adds a document (NeDB assigns an _id if omitted).

      Parameters

      • doc: NedbDoc

      Returns Promise<NedbDoc>

    • Native find: returns every document matching the Mongo-style query.

      Parameters

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

      Returns Promise<NedbDoc[]>

    • Applies a list of put/del operations sequentially.

      Parameters

      • ops: NedbBatchOp[]

      Returns Promise<void>

    • Lists all document _ids (via find({})).

      Returns Promise<string[]>