bitcount

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

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

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

use \Kuzzle\Kuzzle;


$kuzzle = new Kuzzle('localhost');

try {
  $count = $kuzzle->memoryStorage()->bitcount('key');
}
catch (ErrorException $e) {

}

Callback response:

21

Counts the number of set bits (population counting) in a string.

[Redis documentation]


bitcount(key, [options], callback)

ArgumentsTypeDescription
keystringKey identifier
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 count of set bits