Expire geospatial items in Redis

Viewed 960

There are proposals for sorted set item expiration in Redis (see https://groups.google.com/d/msg/redis-db/rXXMCLNkNSs/Bcbd5Ae12qQJ and https://quickleft.com/blog/how-to-create-and-expire-list-items-in-redis/), I tried the worker approach to expire geospatial indexes with ZREMRANGEBYSCORE and ZREMRANGEBYRANK commands unsuccessfully (nothing removed).

I succeded using ZREMRANGEBYLEX.

Is there a way to work with geospatial items score other than Strings?

Update:

For example, if time to live(ttl) of an item is 30sec, I add it as:

geoadd 1 -8.616021 41.154503 30

Now, suppose worker executes after 40sec, I was expecting that

zremrangebyscore 1 0 40

would do the job, but it does not,

ZREMRANGEBYLEX 1 [0 [40

does it. Why is this behavior? That means the score of a geospatial item supports only lexicographical operations?

1 Answers
Related