redis-mock icon indicating copy to clipboard operation
redis-mock copied to clipboard

Implement sorted set commands

Open Esya opened this issue 11 years ago • 6 comments

Redis-mock does not implement the followings :

    "zadd",
    "zcard",
    "zcount",
    "zincrby",
    "zinterstore",
    "zrange",
    "zrangebyscore",
    "zrank",
    "zrem",
    "zremrangebyrank",
    "zremrangebyscore",
    "zrevrange",
    "zrevrangebyscore",
    "zrevrank",
    "zscore",
    "zunionstore"

Ref : https://github.com/mranney/node_redis/blob/master/lib/commands.js

Esya avatar Sep 17 '13 10:09 Esya

This would be cool :)

jprichardson avatar Nov 08 '13 20:11 jprichardson

I am working on Sorted Sets support. Anyone has work done on this?

PauloASilva avatar Dec 31 '14 11:12 PauloASilva

In which file does ZADD should go?

https://github.com/faeldt/redis-mock/tree/master/lib

Maybe a new file zfunctions.js?

madeinjam avatar Feb 11 '15 17:02 madeinjam

@jamc I was working on z* functions. I have zcard, zadd, zrem All of them were implemented at lib/sorted-set.js file.

Have a look at my sorted-set branch.

Then I started implementing the multi features and I think that I gave up. I'm not sure that re-implementing the logics behind redis in node.js is the right way to go.

PauloASilva avatar Feb 11 '15 18:02 PauloASilva

Any updates about this feature?

GuillaumeCisco avatar Oct 14 '15 10:10 GuillaumeCisco

@GuillaumeCisco I gave up on this. As I said before it doesn't make sense (to me) implementing redis' logics in node when you have no way to validate that you're reaching the same behaviour.

What I am doing on unit tests which require Redis is a stub on redis client methods to return mocks. As expected unit test shouldn't keep state, so it works like a charm.

Let me know if I can help you further.

PauloASilva avatar Oct 14 '15 10:10 PauloASilva