node-redis
node-redis copied to clipboard
problem using Bitop
Dear all,
i have several key ex: uniq:1..uniq:n then i want to do bitop to all key. bitop or uniq:1 uniq:2 uniq:3 uniq:4 ... uniq:n note :n value is dynamic.
how i can implement this in node redis?
thank you
jimmy
var c = require('redis').createClient()
c.setbit('uniq:1', 7, 1)
c.setbit('uniq:2', 6, 1)
c.setbit('uniq:3', 7, 1)
c.bitop('or', 'uniq:or', 'uniq:1', 'uniq:2', 'uniq:3')
If you need the list of keys to be truly dynamic, you'll probably need to use send_command
c.send_command('bitop', ['or', 'uniq:or', 'uniq:1', 'uniq:2', 'uniq:3'])