Search code examples
javaredislettuce

How can i delete element in set Redis?


how can i delete element(s) from sorted set generated from adding location using GEOADD

for example:

GEOADD test -0.12455 51.5007 "Big Ben" -0.12520 51.50115 "Westminster Station" -0.11358 51.50482 "BFI IMAX"

i want to delete "Westminster Station" element , any ideas? and is there away to delete this element using Lettuce Api?


Solution

  • The GEO index is implemented with Sorted Set, so you can just use zrem to remove a location.

    `zrem test "Westminster Station"`