Problems with ZADD with INCR option

62 views
Skip to first unread message

HeartSaVioR

unread,
Jul 23, 2015, 7:49:58 PM7/23/15
to Redis DB
Hi!

I couldn't follow Redis releases for a while, and see new Redis releases which extends ZADD with various parameters.
It is great to add it, without INCR option.

Normally Redis replies ZADD operation to INTEGER reply, which is Integer, but with INCR option Redis replies to Bulk String reply, which is String.

Now we're having two different return "type" of same operation, which I don't quite understand why you allow it.
It is not small issue for driver with static type language, cause we should implement same operation twice (with INCR, without INCR) with different semantic (for example, with INCR, we should convert String to Double to let users enjoy with actual data type).

I strongly think it should be fixed, and there's a way to keep same functionality with safe way.
- How about removing INCR option from ZADD and adding NX / XX option to ZINCRBY?
It should be same without making a headache, cause it doesn't change return type whatever combination of option users provide.

For a reference, Jedis is struggling with this issue: https://github.com/xetorthio/jedis/issues/1067

Best,
Jungtaek Lim (HeartSaVioR)

HeartSaVioR

unread,
Jul 23, 2015, 9:08:20 PM7/23/15
to Redis DB, kab...@gmail.com
Since it is already released feature, so deprecating (not removing right now) ZADD with INCR also makes sense for me.

- Jungtaek Lim (HeartSaVioR)

2015년 7월 24일 금요일 오전 8시 49분 58초 UTC+9, HeartSaVioR 님의 말:
Reply all
Reply to author
Forward
0 new messages