Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request for ZREM like command for GEO commands #2674

Closed
tvmaly opened this issue Jul 15, 2015 · 5 comments
Closed

request for ZREM like command for GEO commands #2674

tvmaly opened this issue Jul 15, 2015 · 5 comments

Comments

@tvmaly
Copy link

tvmaly commented Jul 15, 2015

would it be possible to get a command like ZREM for the new GEO commands so that one could remove a member added by geoadd ?

Best regards,

Ty

@badboy
Copy link
Contributor

badboy commented Jul 15, 2015

If you want to remove by the name you used in GEOADD, that's already possible. Just use ZREM.
The Geo functionality is implemented on top of a normal sorted set, so all sorted set commands still apply.

127.0.0.1:6379> GEOADD Sicily 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"
(integer) 0
127.0.0.1:6379> TYPE Sicily
zset
127.0.0.1:6379> ZRANGE Sicily 0 -1
1) "Palermo"
2) "Catania"
127.0.0.1:6379> ZREM Sicily Palermo
(integer) 1
127.0.0.1:6379> ZRANGE Sicily 0 -1
1) "Catania"

@charsyam
Copy link
Contributor

@tvmaly Yes, actually geoadd is like zadd. so you can remove it with zrem.
But I think georem is more intuitive.
#2675

@antirez
Copy link
Contributor

antirez commented Jul 17, 2015

I've the feeling that if we don't add an alias for ZREM this will be among the top questions in the ML / IRC for the next months...

@tvmaly
Copy link
Author

tvmaly commented Jul 23, 2015

Thanks, perhaps just a entry in the docs under GEOREM that just says use ZREM would be enought, at least it would for me.

@oranagra
Copy link
Member

oranagra commented Aug 3, 2021

This issue was probably posted when the geo commands where new, but i suppose now that much time has passed, it's less relevant and i wanna close it, since the use of ZREM for geo is already established and documented.

I think that one day we wanna make GEO a proper type.
i.e. internally it can be written to reuse the zset code, but TYPE command should indicate that it's a geo key, and the RDB file serialization should reflect that as well.
Till then, as long as the TYPE indicates that it's a ZSET, and it is documented that ZREM should be used, i don't think we wanna add any command aliases.

@oranagra oranagra closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants