bitpos

// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.bitpos('key', 0, function (err, position) {
  // callback called once the action has completed
});

// Using promises (NodeJS only)
kuzzle.memoryStorage.bitpos('key', 0)
  .then(position => {
    // resolved once the action has completed
  });
kuzzle.memoryStorage.bitpos("key", 0, new ResponseListener<Long>() {
  @Override
  public void onSuccess(int position) {
    // callback called once the action has completed
  }

  @Override
  public void onError(JSONObject error) {
  }
});
<?php

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $position = $kuzzle->memoryStorage()->bitpos('key', 0);
}
catch (ErrorException $e) {

}

Callback response:

0

Returns the position of the first bit set to 1 or 0 in a string, or in a substring.

[Redis documentation]


bitpos(key, bit, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
bitintBit to search.
Allowed values: 0, 1
optionsJSON ObjectOptional parameters
callbackfunctionCallback

Options

OptionTypeDescriptionDefault
endintEnding offset-1
queuablebooleanMark this request as (not) queuabletrue
startintStarting offset0

Callback response

Resolves to an integer containing the first position of the searched bit in the string value