Reputation: 241
I have multiple keys and values which I can set to Redis by calling 'set' method multiple times which just takes (key, value).
How can I do the same with Redis 'mset' command and pass those key,value pairs?
Upvotes: 0
Views: 1078
Reputation: 3184
using ioredis:
client.MSET('key1', 'value1', 'key2', 'value2');
using node-redis:
client.MSET({ 'key1': 'value1', 'key2': 'value2' });
client.MSET(['key1', 'value1', 'key2', 'value2']);
client.MSET([['key1', 'value1'], ['key2', 'value2']]);
Upvotes: 2