Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisStorageEngine<T>

StorageEngine which uses redis as a datasource

Type parameters

  • T

Hierarchy

Index

Methods

addToList

  • addToList(listId: string, id: string): Promise<void>

filter

  • filter(fn: (value?: T, index?: number, array?: T[]) => unknown, ids: string[], namespace: string): Promise<any[]>
  • Filter for an object

    Parameters

    • fn: (value?: T, index?: number, array?: T[]) => unknown

      filter function to use

        • (value?: T, index?: number, array?: T[]): unknown
        • Parameters

          • Optional value: T
          • Optional index: number
          • Optional array: T[]

          Returns unknown

    • ids: string[]

      array of ids that should be used for the filtering

    • namespace: string

      namespace of the filter

    Returns Promise<any[]>

    filtered data

find

  • find(fn: (value?: T, index?: number, array?: string[]) => boolean, ids?: null | string[], namespace: string): Promise<null | T>
  • Filter for an object and return after the first search success

    Parameters

    • fn: (value?: T, index?: number, array?: string[]) => boolean

      filter function to use

        • (value?: T, index?: number, array?: string[]): boolean
        • Parameters

          • Optional value: T
          • Optional index: number
          • Optional array: string[]

          Returns boolean

    • ids: null | string[] = null

      array of ids that should be used for the filtering

    • namespace: string

      namespace of the filter

    Returns Promise<null | T>

    the first result or null if nothing was found

get

  • get(id: string): Promise<null | T>
  • get(id: string, useHash: boolean): Promise<string>

getListCount

  • getListCount(listId: string): Promise<number>

getListMembers

  • getListMembers(listId: string): Promise<string[]>

initialize

isListMember

  • isListMember(listId: string, id: string): Promise<boolean>

parseData

  • parseData(data: null | string): null | T

prepareData

  • prepareData(data: T): string

prepareNamespace

  • prepareNamespace(namespace: string): string

remove

  • remove(id: string, useHash?: boolean): Promise<void>

removeFromList

  • removeFromList(listId: string, id: string): Promise<void>

removeList

  • removeList(listId: string): Promise<void>

upsert

  • upsert(id: string, updateData: any, useHash?: boolean): Promise<void>

Properties

client

client: null | RedisClient

whether this storage engine is ready for usage

options

options that are passed to the redis client

ready

ready: boolean

useHash

useHash: boolean

whether hash objects should be used for storing data

Constructors

constructor

Generated using TypeDoc