Method: Redis::Commands::Bitmaps#bitop

Defined in:
lib/redis/commands/bitmaps.rb

#bitop(operation, destkey, *keys) ⇒ Integer

Perform a bitwise operation between strings and store the resulting string in a key.

Parameters:

  • operation (String)

    e.g. ‘and`, `or`, `xor`, `not`

  • destkey (String)

    destination key

  • keys (String, Array<String>)

    one or more source keys to perform ‘operation`

Returns:

  • (Integer)

    the length of the string stored in ‘destkey`



41
42
43
44
45
46
# File 'lib/redis/commands/bitmaps.rb', line 41

def bitop(operation, destkey, *keys)
  keys.flatten!(1)
  command = [:bitop, operation, destkey]
  command.concat(keys)
  send_command(command)
end