Interface Store<Key, Value, Pair, HasOptionsExtension, PutOptionsExtension, PutManyOptionsExtension, GetOptionsExtension, GetManyOptionsExtension, DeleteOptionsExtension, DeleteManyOptionsExtension>

interface Store<Key, Value, Pair, HasOptionsExtension, PutOptionsExtension, PutManyOptionsExtension, GetOptionsExtension, GetManyOptionsExtension, DeleteOptionsExtension, DeleteManyOptionsExtension> {
    delete(key, options?): Await<void>;
    deleteMany(source, options?): AwaitIterable<Key>;
    get(key, options?): Await<Value>;
    getMany(source, options?): AwaitIterable<Pair>;
    has(key, options?): Await<boolean>;
    put(key, val, options?): Await<Key>;
    putMany(source, options?): AwaitIterable<Key>;
}

Type Parameters

  • Key
  • Value
  • Pair
  • HasOptionsExtension = {}
  • PutOptionsExtension = {}
  • PutManyOptionsExtension = {}
  • GetOptionsExtension = {}
  • GetManyOptionsExtension = {}
  • DeleteOptionsExtension = {}
  • DeleteManyOptionsExtension = {}

Hierarchy

  • Store

    Methods

    • Retrieve the value stored under the given key

      Parameters

      Returns Await<Value>

      Example

      const value = await store.get(new Key('awesome'))
      console.log('got content: %s', value.toString('utf8'))
      // => got content: datastore
    • Check for the existence of a value for the passed key

      Parameters

      Returns Await<boolean>

      Example

      const exists = await store.has(new Key('awesome'))

      if (exists) {
      console.log('it is there')
      } else {
      console.log('it is not there')
      }