I want to incapsulate redis hmset
.
exports.hmset = (name, autocb, params...)=>
await client.hmset name, params, defer(err)
throw err if err
I have that params
is array like ['fooKey', 'fooValue', 'barKey', 'barValue']
. But then I have data in redis database on name
key:
{'0' : 'fooKey', '1' : 'fooValue', '2' : 'barKey', '3': 'barValue'}
But I want it to be:
{'fooKey' : 'fooValue', 'barKey' : 'barValue'}
I understand that I have to pass them into client.hmset
not like an array ['fooKey', 'fooValue', 'barKey', 'barValue']
but just like args: 'fooKey', 'fooValue', 'barKey', 'barValue'
. But how to pass them through wrapping exports.hmset
function when args length is various?