bitop #
Performs a bitwise operation between multiple keys (containing string values) and stores the result in the destination key.
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 #
String[] sourceKeys = {"srckey1", "srckey2", "..."};
kuzzle.memoryStorage.bitop("key", "AND", sourceKeys, new ResponseListener<Long>() {
@Override
public void onSuccess(int length) {
// callback called once the action has completed
}
@Override
public void onError(JSONObject error) {
}
});
Callback response:
42
Edit this page on Github(opens new window)