SDK
SDK Android v3.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

bitpos #

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
queuablebooleanMake this request queuable or nottrue
startintStarting offset0

Callback Response #

Returns an integer containing the first position of the searched bit in the string value.

Usage #

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) {
  }
});

Callback response:

0