stores
    Preparing search index...

    A datastore shim, that wraps around a given datastore, changing the way keys look to the user, for example namespacing keys, reversing them, etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    transform: KeyTransform

    Methods

    • This will return an object with which you can chain multiple operations together, with them only being executed on calling commit.

      Returns Batch

      const b = store.batch()

      for (let i = 0; i < 100; i++) {
      b.put(new Key(`hello${i}`), new TextEncoder('utf8').encode(`hello world ${i}`))
      }

      await b.commit()
      console.log('put 100 values')
    • Query the datastore.

      Parameters

      Returns AsyncIterable<Pair>

      // retrieve __all__ key/value pairs from the store
      let list = []
      for await (const { key, value } of store.query({})) {
      list.push(value)
      }
      console.log('ALL THE VALUES', list)