As I understand it, you are using the varargs convention of calling hmset
. You use a splat to collect the arguments in an array, and then you pass the array as an argument to node_redis -- which also supports the object convention, where you pass a plain object with the keys and their values. That's why you get your redis hash with positional keys, since if you treat a javascript array as an object, that's what you have.
What you need to do is simply to splat the params
again when calling redis:
exports.hmset = (name, autocb, params...)=>
await client.hmset name, params..., defer(err)
throw err if err
Now, coffeescript will pass that array as varargs to the "real" hmset
. As an added bonus, you can also still use the "params as an object" convention, which is arguably more elegant.