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

ZRangeReply do not have aslist method #119

Open
cocoakekeyu opened this issue Mar 22, 2018 · 0 comments
Open

ZRangeReply do not have aslist method #119

cocoakekeyu opened this issue Mar 22, 2018 · 0 comments

Comments

@cocoakekeyu
Copy link

as document say:
http://asyncio-redis.readthedocs.io/en/latest/pages/reference.html#asyncio_redis.RedisProtocol.zrange

zrange(self, tr, key, start=0, stop=-1)
Return a range of members in a sorted set, by index.

You can do the following to receive the slice of the sorted set as a python dict (mapping the keys to their scores):

result = yield protocol.zrange('myzset', start=10, stop=20)
my_dict = yield result.asdict()
or the following to retrieve it as a list of keys:

result = yield protocol.zrange('myzset', start=10, stop=20)
my_dict = yield result.aslist()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant