Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisIntervalSets

Hierarchy

  • Module
    • RedisIntervalSets

Index

Constructors

  • new RedisIntervalSets(clusterNodes: ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: ClusterOptions): RedisIntervalSets
  • new RedisIntervalSets(redisOptions: RedisOptions, moduleOptions?: RedisModuleOptions): RedisIntervalSets
  • Initializing the module object

    Parameters

    • clusterNodes: ClusterNode[]

      The nodes of the cluster

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    • Optional clusterOptions: ClusterOptions

      The options of the clusters

    Returns RedisIntervalSets

  • Initializing the module object

    Parameters

    • redisOptions: RedisOptions

      The options of the redis database

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    Returns RedisIntervalSets

Properties

cluster: Cluster
clusterNodes: ClusterNode[]
clusterOptions: ClusterOptions
isHandleError: boolean
name: string
redis: Redis
redisOptions: RedisOptions
returnRawResponse: boolean
risCommander: RedisIntervalSetsCommander = ...
risHelpers: RedisIntervalSetsHelpers = ...
showDebugLogs: boolean

Methods

  • Adding an interval set

    Parameters

    • key: string

      The name of the key

    • sets: RedisIntervalSet[]

      A list of sets to create. At least 1 set is required.

    Returns Promise<"OK">

  • connect(): Promise<void>
  • Connecting to the Redis database with the module

    Returns Promise<void>

  • del(key: string, setNames?: string[]): Promise<"OK">
  • Deleting a all interval sets under a key, or a single/list of specific set/s.

    Parameters

    • key: string

      The name of the key

    • Optional setNames: string[]

      Optional. A list of set names to delete. If not passed all interval sets under key will be removed.

    Returns Promise<"OK">

  • disconnect(): Promise<void>
  • Disconnecting from the Redis database with the module

    Returns Promise<void>

  • Retrieving all of key interval sets/a single set.

    Parameters

    • key: string

      The name of the key

    • Optional setName: string

      Optional. The name of specific set. If not passed all interval sets under key will be retrieved.

    Returns Promise<RedisIntervalSet[]>

  • handleError(error: string): any
  • Handling a error

    Parameters

    • error: string

      The message of the error

    Returns any

  • handleResponse(response: any): any
  • Simpilizing the response of the Module command

    Parameters

    • response: any

      The array response from the module

    Returns any

  • isOnlyTwoDimensionalArray(array: any[]): boolean
  • Check if array is fully two dimensional. Only items in the array are arrays.

    Parameters

    • array: any[]

      The potential two dimensional array

    Returns boolean

  • notScore(key: string, score: number): Promise<string[]>
  • Retrieving all sets under a key that don't have a specific score in their range.

    Parameters

    • key: string

      The name of the key

    • score: number

      The score of the set

    Returns Promise<string[]>

  • paramToString(paramValue: string): string
  • Formatting given param value to string

    Parameters

    • paramValue: string

      The given param value

    Returns string

    A param value converted to string

  • reduceArrayDimension(array: any[][]): any[]
  • Reducing an array by one level. i.e. from two dimensional to 1 dimensional.

    Parameters

    • array: any[][]

      The potentional two dimensional array

    Returns any[]

  • score(key: string, score: number): Promise<string[]>
  • Retrieving all sets under a key that have a specific score in their range.

    Parameters

    • key: string

      The name of the key

    • score: number

      The score of the set

    Returns Promise<string[]>

  • sendCommand(data: CommandData): Promise<any>
  • Running a Redis command

    Parameters

    • data: CommandData

      The command data of a command to send. Consists of command and args.

    Returns Promise<any>

Generated using TypeDoc