Options
All
  • Public
  • Public/Protected
  • All
Menu

SingleRangeBuilder is a query builder that looks up a single key.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected callOptions

callOptions: CallOptions | undefined

Protected Readonly namespace

namespace: NSApplicator

Protected request

request: IRangeRequest

Methods

buffer

  • buffer(): Promise<Buffer | null>
  • Runs the built request and returns the value of the returned key as a buffer, or null if it isn't found.

    Returns Promise<Buffer | null>

catch

  • catch<R>(onRejected: (err: any) => R | Promise<R>): Promise<(string | null) | R>
  • catch implements Promiselike.catch()

    Type parameters

    • R

    Parameters

    • onRejected: (err: any) => R | Promise<R>
        • (err: any): R | Promise<R>
        • Parameters

          • err: any

          Returns R | Promise<R>

    Returns Promise<(string | null) | R>

Protected createPromise

  • createPromise(): Promise<string | null>

exec

exists

  • exists(): Promise<boolean>

json

  • json(): Promise<unknown>
  • Runs the built request and parses the returned key as JSON, or returns null if it isn't found.

    Returns Promise<unknown>

maxCreateRevision

  • maxCreateRevision(maxCreateRevision: number | string): this

maxModRevision

  • maxModRevision(maxModRevision: number | string): this

minCreateRevision

  • minCreateRevision(minCreateRevision: number | string): this

minModRevision

  • minModRevision(minModRevision: number | string): this

number

  • number(): Promise<number | null>
  • Runs the built request, and returns the value parsed as a number. Resolves as NaN if the value can't be parsed as a number.

    Returns Promise<number | null>

op

options

  • options(options: CallOptions | undefined): this

revision

  • revision(rev: number | string): this
  • revision is the point-in-time of the key-value store to use for the range.

    Parameters

    • rev: number | string

    Returns this

serializable

  • serializable(serializable: boolean): this

string

  • string(encoding?: BufferEncoding): Promise<string | null>
  • Runs the built request and returns the value of the returned key as a string, or null if it isn't found.

    Parameters

    • Default value encoding: BufferEncoding = "utf8"

    Returns Promise<string | null>

then

  • then<R, V>(onFulfilled: (value: string | null) => R | Promise<R>, onRejected?: undefined | ((err: any) => V | Promise<V>)): Promise<R | V>
  • then implements Promiselike.then()

    Type parameters

    • R

    • V

    Parameters

    • onFulfilled: (value: string | null) => R | Promise<R>
        • (value: string | null): R | Promise<R>
        • Parameters

          • value: string | null

          Returns R | Promise<R>

    • Optional onRejected: undefined | ((err: any) => V | Promise<V>)

    Returns Promise<R | V>

Legend

  • Constructor
  • Method
  • Inherited method

Generated using TypeDoc