SDK
SDK PHP 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.

bitop #

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]) #

Arguments Type Description
key string Destination key identifier
operation string Bitwise operation to perform.
Allowed values: AND, OR, XOR, NOT
keys array list of source keys on which the bitwise operation will be applied
options JSON Object Optional parameters
callback function Callback

Options #

Option Type Description Default
queuable boolean Make this request queuable or not true

Return Value #

Returns the MemoryStorage object to allow chaining.


Callback Response #

Returns an integer containing the length of the new key's value.

Usage #

Copied to clipboard!
<?php
use \Kuzzle\Kuzzle;
$kuzzle = new Kuzzle('localhost');
try {
  $length = $kuzzle->memoryStorage()->bitop('key', 'AND', ['srckey1', 'srckey2', '...']);
}
catch (ErrorException $e) {
}

Callback response:

Copied to clipboard!
42