I am brand new to redis so I have a number of questions regarding the setbit function.
I have a dataset of the following type:
{'items':[{'item_1':0001...1000,
...
'item_n':0011...0011}
]
}
In each item there are 10's of thousands of bits and there are hundreds of thousands of items. It seems that I can use the following to set the items:
Redis.setbit('item1', 0, 0)
Redis.setbit('item1', 1, 0)
Redis.setbit('item1', 2, 0)
Redis.setbit('item1', 3, 1)
...
- However this seems horribly inefficient. Is there anyway to set all of the bits at once?
- Is there someway that I can group these into a set or a hash so I can lookup what items are currently set? They change on a daily basis and I need to know what was previously written so I can analyze and delete it accordingly.
- How can I look up the names of the previously written items?