question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zrevrange() gives empty results

See original GitHub issue
  • Version: 5.0.3(Linux on Docker)
  • Platform: Node.js v8.12.0 on Windows 10
  • Description: zrevrange() returns [] even though on redis-cli it gives non-empty array as result.

let idList = await this.client.zrevrange(${this.exactStore}:${word}, 0, -1);

Output from Code:

console.log(ZREVRANGE ${this.exactStore}:${word} 0 -1); produces the following ZREVRANGE exactstore:rse:frank⁠ 0 -1 []

Output from Redis-Cli:

127.0.0.1:6379> ZREVRANGE exactstore:rse:frank 0 -1

  1. “aG2_aHKvxFEzE9CeUlo_y”
  2. “JHihXTds2T0cNnr4er0D1”

Please take a look at node_redis for the same issue in node_redis libary.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
privateOmegacommented, Jan 14, 2019

@luin Thanks for the important information. I got the commands back and is being executed on same db, but I found out that there’s a word joiner unicode character \xe2\x81\xa0 present in the strings which are actually present in the db. But there’s no extra unicode character in my string before I pass it to zrevrange().

0reactions
privateOmegacommented, Jan 19, 2019

@luin yes ofcourse, after identifying that an extra unicode character is present, I got the idea that it had nothing to do with neither redis client nor redis itself. I was asking that doubt in general.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis ZRANGEBYSCORE returning empty set - Stack Overflow
Usually I'd try to use a sorted set for each model/event that being tracked per aggregation level needed. Key expiration is useful, but ......
Read more >
ZREVRANGE - Redis
Returns the specified range of elements in the sorted set stored at key . The elements are considered to be ordered from the...
Read more >
ZREVRANGE | YugabyteDB Docs
This command returns members ordered from highest to lowest score in the specified range at sorted set key . start and stop represent...
Read more >
zrange returns empty list or set : r/redis - Reddit
I am using RedisTemplate to add and retrieve sorted set values. Though the 'zadd' part works fine. On performing zrange, empty list is ......
Read more >
SortedSetsApi - extends ApiSubset
The type constructor into which a result of each command is wrapped. ... false): Result[Int]. Executes ZADD or simply returns 0 when memberScores...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found