0
client.xrevrange('TEST_STREAM','count 1',function (err,Data) {
  if (err) {
    return console.error(err);  
} else
console.log("Data from stream is:",Data);
  });

I'm trying to read the data from Redis stream and this line is giving me this error:

ERROR:" ReplyError: ERR wrong number of arguments for 'xrevrange' command"

I need help regarding this error or if there is another way to read data from Redis stream do let me know.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

1 Answers1

0

You forgot some arguments, try :

client.xrevrange('TEST_STREAM','+', '-', 'COUNT', 1,function (err,Data) { 
 if (err) {
    return console.error(err);  
} else
console.log("Data from stream is:",Data);
  });
Yann
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Tyler2P Nov 09 '21 at 17:26