Is there any way to update the sorted set using redis client in node in bulk

90 Views Asked by At

I want to update the sorted set record using Redis client in node js. for update the one record I use client.zAdd(key,{score:score, value:memberId}) . Is there any command or function that I can use for the bulk update in Redis. I google this but didn't get any solution.

thank you in advance.

1

There are 1 best solutions below

0
Avneesh Singhal On

For bulk update you can use

List members = [
  {
    score: score,
    value: memberId
  }, {
    score: score,
    value: memberId
  }, {
    score:score,
    value:memberId
  }, ...
];
    
   
client.zAdd(key,members);