SDK Java v2.x

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] (opens new window)

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

Arguments Type Description
key string Key identifier
bit int Bit to search.
Allowed values: 0, 1
options JSON Object Optional parameters
callback function Callback

Options #

Option Type Description Default
end int Ending offset -1
queuable boolean Make this request queuable or not true
start int Starting offset 0

Callback Response #

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

Usage #

Copied to clipboard!
kuzzle.memoryStorage.bitpos("key", 0, new ResponseListener<Long>() {
  public void onSuccess(int position) {
    // callback called once the action has completed
  public void onError(JSONObject error) {

Callback response:

Copied to clipboard!