// Using callbacks (NodeJS or Web Browser)
kuzzle.memoryStorage.bitop('key', 'AND', ['srckey1', 'srckey2', '...'], function (err, length) {
  // callback called once the action has completed

// Using promises (NodeJS only)
kuzzle.memoryStorage.bitopPromise('key', 'AND', ['srckey1', 'srckey2', '...'])
  .then(length => {
    // resolved once the action has completed
String[] sourceKeys = {"srckey1", "srckey2", "..."};

kuzzle.memoryStorage.bitop("key", "AND", sourceKeys, new ResponseListener<Long>() {
  public void onSuccess(int length) {
    // callback called once the action has completed

  public void onError(JSONObject error) {

use \Kuzzle\Kuzzle;

$kuzzle = new Kuzzle('localhost');

try {
  $length = $kuzzle->memoryStorage()->bitop('key', 'AND', ['srckey1', 'srckey2', '...']);
catch (ErrorException $e) {


Callback response:


Performs a bitwise operation between multiple keys (containing string values) and stores the result in the destination key.

[Redis documentation]

bitop(key, operation, keys, [options], [callback])

keystringDestination key identifier
operationstringBitwise operation to perform.
Allowed values: AND, OR, XOR, NOT
keysarraylist of source keys on which the bitwise operation will be applied
optionsJSON ObjectOptional parameters


queuablebooleanMark this request as (not) queuabletrue

Return value

Returns the MemoryStorage object to allow chaining.

Callback response

Resolves to an integer containing the length of the new key's value