Class RedisConnectionPool

RedisConnectionPool

Hierarchy

  • RedisConnectionPool

Constructors

Properties

initializing: boolean = false
max_clients: number = 5
pool: Pool<RedisClientType<{ bf: { ADD: __module; EXISTS: __module; INFO: __module; INSERT: __module; LOADCHUNK: __module; MADD: __module; MEXISTS: __module; RESERVE: __module; SCANDUMP: __module; add: __module; exists: __module; info: __module; insert: __module; loadChunk: __module; mAdd: __module; mExists: __module; reserve: __module; scanDump: __module }; cf: { ADD: __module; ADDNX: __module; COUNT: __module; DEL: __module; EXISTS: __module; INFO: __module; INSERT: __module; INSERTNX: __module; LOADCHUNK: __module; RESERVE: __module; SCANDUMP: __module; add: __module; addNX: __module; count: __module; del: __module; exists: __module; info: __module; insert: __module; insertNX: __module; loadChunk: __module; reserve: __module; scanDump: __module }; cms: { INCRBY: __module; INFO: __module; INITBYDIM: __module; INITBYPROB: __module; MERGE: __module; QUERY: __module; incrBy: __module; info: __module; initByDim: __module; initByProb: __module; merge: __module; query: __module }; ft: { AGGREGATE: __module; AGGREGATE_WITHCURSOR: __module; ALIASADD: __module; ALIASDEL: __module; ALIASUPDATE: __module; ALTER: __module; CONFIG_GET: __module; CONFIG_SET: __module; CREATE: __module; CURSOR_DEL: __module; CURSOR_READ: __module; DICTADD: __module; DICTDEL: __module; DICTDUMP: __module; DROPINDEX: __module; EXPLAIN: __module; EXPLAINCLI: __module; INFO: __module; PROFILEAGGREGATE: __module; PROFILESEARCH: __module; SEARCH: __module; SPELLCHECK: __module; SUGADD: __module; SUGDEL: __module; SUGGET: __module; SUGGET_WITHPAYLOADS: __module; SUGGET_WITHSCORES: __module; SUGGET_WITHSCORES_WITHPAYLOADS: __module; SUGLEN: __module; SYNDUMP: __module; SYNUPDATE: __module; TAGVALS: __module; _LIST: __module; _list: __module; aggregate: __module; aggregateWithCursor: __module; aliasAdd: __module; aliasDel: __module; aliasUpdate: __module; alter: __module; configGet: __module; configSet: __module; create: __module; cursorDel: __module; cursorRead: __module; dictAdd: __module; dictDel: __module; dictDump: __module; dropIndex: __module; explain: __module; explainCli: __module; info: __module; profileAggregate: __module; profileSearch: __module; search: __module; spellCheck: __module; sugAdd: __module; sugDel: __module; sugGet: __module; sugGetWithPayloads: __module; sugGetWithScores: __module; sugGetWithScoresWithPayloads: __module; sugLen: __module; synDump: __module; synUpdate: __module; tagVals: __module }; graph: { CONFIG_GET: __module; CONFIG_SET: __module; DELETE: __module; EXPLAIN: __module; LIST: __module; PROFILE: __module; QUERY: __module; QUERY_RO: __module; SLOWLOG: __module; configGet: __module; configSet: __module; delete: __module; explain: __module; list: __module; profile: __module; query: __module; queryRo: __module; slowLog: __module }; json: { ARRAPPEND: __module; ARRINDEX: __module; ARRINSERT: __module; ARRLEN: __module; ARRPOP: __module; ARRTRIM: __module; DEBUG_MEMORY: __module; DEL: __module; FORGET: __module; GET: __module; MGET: __module; NUMINCRBY: __module; NUMMULTBY: __module; OBJKEYS: __module; OBJLEN: __module; RESP: __module; SET: __module; STRAPPEND: __module; STRLEN: __module; TYPE: __module; arrAppend: __module; arrIndex: __module; arrInsert: __module; arrLen: __module; arrPop: __module; arrTrim: __module; debugMemory: __module; del: __module; forget: __module; get: __module; mGet: __module; numIncrBy: __module; numMultBy: __module; objKeys: __module; objLen: __module; resp: __module; set: __module; strAppend: __module; strLen: __module; type: __module }; topK: { ADD: __module; COUNT: __module; INCRBY: __module; INFO: __module; LIST: __module; LIST_WITHCOUNT: __module; QUERY: __module; RESERVE: __module; add: __module; count: __module; incrBy: __module; info: __module; list: __module; listWithCount: __module; query: __module; reserve: __module }; ts: { ADD: __module; ALTER: __module; CREATE: __module; CREATERULE: __module; DECRBY: __module; DEL: __module; DELETERULE: __module; GET: __module; INCRBY: __module; INFO: __module; INFO_DEBUG: __module; MADD: __module; MGET: __module; MGET_WITHLABELS: __module; MRANGE: __module; MRANGE_WITHLABELS: __module; MREVRANGE: __module; MREVRANGE_WITHLABELS: __module; QUERYINDEX: __module; RANGE: __module; REVRANGE: __module; add: __module; alter: __module; create: __module; createRule: __module; decrBy: __module; del: __module; deleteRule: __module; get: __module; incrBy: __module; info: __module; infoDebug: __module; mAdd: __module; mGet: __module; mGetWithLabels: __module; mRange: __module; mRangeWithLabels: __module; mRevRange: __module; mRevRangeWithLabels: __module; queryIndex: __module; range: __module; revRange: __module } }, Record<string, never>, Record<string, never>>>
redis: RedisClientOptions<RedisModules, RedisFunctions, RedisScripts>

Methods

  • Execute a redis BLPOP command

    Parameters

    • key: string

      The list key

    Returns Promise<{ element: SingleCommandResult; key: string }>

  • Execute a redis BRPOP command

    Parameters

    • key: string

      The list key

    Returns Promise<{ element: SingleCommandResult; key: string }>

  • Execute a redis DEL command

    Parameters

    • key: string

      The key of the value you wish to delete

    Returns Promise<number>

  • Execute a redis EXPIRE command

    Parameters

    • key: string

      A key to assign value to

    • ttl: number

      TTL in seconds

    Returns Promise<number>

  • Execute a redis GET command

    Parameters

    • key: string

      The key of the value you wish to get

    Returns Promise<string>

  • Type Parameters

    Type Parameters

    • T

    Parameters

    • funcName: FuncNames
    • key: string
    • field: string = undefined

    Returns Promise<T>

  • Execute a redis HDEL command

    Parameters

    • key: string

      The key of the value you wish to delete

    • fields: string[]

      Array of additional field names to be deleted

    Returns Promise<number>

  • Execute a redis HGET command

    Parameters

    • key: string

      The key of the hash you wish to get

    • field: string

      The field name to retrieve

    Returns Promise<string>

  • Execute a redis HGETALL command

    Parameters

    • key: string

      The key of the hash you wish to get

    Returns Promise<{ [index: string]: string }>

  • Execute a redis HSET command

    Parameters

    • key: string

      A key to assign the hash to

    • field: string

      Name of the field to set

    • data: string

      Value to assign to hash

    Returns Promise<number>

  • Execute a redis INCR command

    Parameters

    • key: string

      A key whose value you wish to increment

    Returns Promise<number>

  • Initializes the Redis connection pool, connecting to redis.

    Returns Promise<void>

  • Execute a redis KEYS command

    Parameters

    • key: string

      The prefix of the keys to return

    Returns Promise<string[]>

  • Execute a redis LPUSH command

    Parameters

    • key: string

      The list key

    • data: string

      Value to assign to the list

    Returns Promise<number>

  • Execute a redis RPUSH command

    Parameters

    • key: string

      The list key

    • data: string

      Value to assign to the list

    Returns Promise<number>

  • Sends an explicit command to the redis server. Helpful for all the commands in redis that aren't supported natively by this pool API.

    Example

    sendCommand('ECHO', ['Hello Redis'] )
    

    Parameters

    • command_name: string

      Name of redis command to execute

    • args: string[]

      List of arguments for the redis command

    Returns Promise<SingleCommandResult>

  • Execute a redis SET command

    Parameters

    • key: string

      A key to assign value to

    • data: string | number

      Value to assign to key

    • ttl: number = 0

      TTL (Time to Live) in seconds

    Returns Promise<string>

  • Drain the pool and close all connections to Redis.

    Returns Promise<void>

  • Parameters

    • funcName: FuncNames
    • functionParams: any[] = []

    Returns Promise<SingleCommandResult>

  • Execute a redis TTL command

    Parameters

    • key: string

      A key whose TTL(time-to-expire) will be returned

    Returns Promise<number>

Generated using TypeDoc