Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisBloom

Hierarchy

  • Module
    • RedisBloom

Index

Constructors

  • new RedisBloom(clusterNodes: ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: ClusterOptions): RedisBloom
  • new RedisBloom(redisOptions: RedisOptions, moduleOptions?: RedisModuleOptions): RedisBloom
  • 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 RedisBloom

  • Initializing the module object

    Parameters

    • redisOptions: RedisOptions

      The options of the redis database

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    Returns RedisBloom

Properties

bloomCommander: BloomCommander = ...
cluster: Cluster
clusterNodes: ClusterNode[]
clusterOptions: ClusterOptions
isHandleError: boolean
name: string
redis: Redis
redisOptions: RedisOptions
returnRawResponse: boolean
showDebugLogs: boolean

Methods

  • add(key: string, item: string): Promise<BFResponse>
  • Adding an item to the Bloom Filter, creating the filter if it does not yet exist.

    Parameters

    • key: string

      The key of the 'BF.ADD' command

    • item: string

      The item of the 'BF.ADD' command

    Returns Promise<BFResponse>

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

    Returns Promise<void>

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

    Returns Promise<void>

  • exists(key: string, item: string): Promise<BFResponse>
  • Determining whether an item may exist in the Bloom Filter or not.

    Parameters

    • key: string

      The key of the 'BF.EXISTS' command

    • item: string

      The key of the 'BF.EXISTS' command

    Returns Promise<BFResponse>

  • 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

  • info(key: string): Promise<string[]>
  • Returning information about a key

    Parameters

    • key: string

      The key of the 'BF.INFO' command

    Returns Promise<string[]>

  • Adding one or more items to the bloom filter, by default creating it if it does not yet exist. There are several arguments which may be used to modify this behavior.

    Parameters

    • key: string

      The key of the 'BF.INSERT' command

    • items: string[]

      The items of the 'BF.INSERT' command

    • Optional options: BFInsertParameters

      The additional optional parameters of the 'BF.INSERT' command

    Returns Promise<BFResponse[]>

  • 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

  • loadchunk(key: string, iterator: number, data: string): Promise<"OK">
  • Restoring a filter previously saved using SCANDUMP.

    Parameters

    • key: string

      The key of the 'BF.LOADCHUNK' command

    • iterator: number

      The iterator of the 'BF.LOADCHUNK' command

    • data: string

      The data of the 'BF.LOADCHUNK' command

    Returns Promise<"OK">

  • madd(key: string, items: string[]): Promise<BFResponse[]>
  • Adding one or more items to the Bloom Filter, creating the filter if it does not yet exist. This command operates identically to BF.ADD except it allows multiple inputs and returns multiple values * @param key

    Parameters

    • key: string
    • items: string[]

      The items of the 'BF.MADD' command

    Returns Promise<BFResponse[]>

  • mexists(key: string, items: string[]): Promise<BFResponse[]>
  • Determining if one or more items may exist in the filter or not.

    Parameters

    • key: string

      The key of the 'BF.MEXISTS' command

    • items: string[]

      The items of the 'BF.MEXISTS' command

    Returns Promise<BFResponse[]>

  • 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[]

  • reserve(key: string, errorRate: number, capacity: number, options?: BFReserveParameter): Promise<"OK">
  • Creating an empty Bloom filter with a given desired error ratio and initial capacity.

    Parameters

    • key: string

      The key under which the filter is to be found

    • errorRate: number

      The desired probability for false positives. This should be a decimal value between 0 and 1. For example, for a desired false positive rate of 0.1% (1 in 1000), error_rate should be set to 0.001. The closer this number is to zero, the greater the memory consumption per item and the more CPU usage per operation.

    • capacity: number

      The number of entries you intend to add to the filter. Performance will begin to degrade after adding more items than this number. The actual degradation will depend on how far the limit has been exceeded. Performance will degrade linearly as the number of entries grow exponentially.

    • Optional options: BFReserveParameter

      The additional optional parameters

    Returns Promise<"OK">

  • scandump(key: string, iterator: number): Promise<string[]>
  • Begining an incremental save of the bloom filter

    Parameters

    • key: string

      The key of the 'BF.SCANDUMP' command

    • iterator: number

      The iterator of the 'BF.SCANDUMP' command

    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