API Docs for: 2.2.2
Show:

FetchMap.Builder Class

A builder for constructing FetchMap instances.

Rather than having to manually construct the options and instantiating a FetchMap directly, this builder may be used.

var fetch = new FetchMap.Builder()
                .withBucketType('myBucketType')
                .withBucket('myBucket')
                .withKey('myKey')
                .withCallback(myCallback)
                .build();

Constructor

FetchMap.Builder

()

Methods

build

() FetchMap

Construct a FetchMap instance.

Returns:

withBasicQuorum

(
  • useBasicQuorum
)
chainable

Set the basic_quorum value. The parameter controls whether a read request should return early in some fail cases. E.g. If a quorum of nodes has already returned notfound/error, don't wait around for the rest.

Parameters:

  • useBasicQuorum Boolean

    the basic_quorum value.

withBucket

(
  • bucket
)
chainable

Set the bucket.

Parameters:

  • bucket String

    the bucket in Riak

withBucketType

(
  • bucketType
)
chainable

Set the bucket type.

Parameters:

  • bucketType String

    the bucket type in riak

withCallback

(
  • callback
)
chainable

Set the callback to be executed when the operation completes.

Parameters:

  • callback Function

    The callback to be executed when the operation completes.

    • err String

      An error message. Will be null if no error.

    • response Object

      The response from Riak. If no map is in Riak for the key, values will be null.

      • context Buffer
        An opaque context to be used in any subsequent modification of the map.
      • map Object
        The map in Riak, converted to a JS object.

withKey

(
  • key
)
chainable

Set the key.

Parameters:

  • key String

    the key in riak.

withPr

(
  • pr
)
chainable

Set the PR value. If not set the bucket default is used.

Parameters:

  • pr Number

    the PR value.

withR

(
  • r
)
chainable

Set the R value. If not set the bucket default is used.

Parameters:

  • r Number

    the R value.

withSetsAsBuffers

(
  • setsAsBuffers
)
chainable

Return sets as arrays of Buffers rather than strings. By default the contents of sets are converted to strings. Setting this to true will cause this not to occur and the raw bytes returned as Buffer objects.

Parameters:

  • setsAsBuffers Boolean

    true to not convert set contents to strings.

withTimeout

(
  • timeout
)
chainable

Set a timeout for this operation.

Parameters:

  • timeout Number

    a timeout in milliseconds.