vedis icon indicating copy to clipboard operation
vedis copied to clipboard

missing command LRANGE

Open hit9 opened this issue 11 years ago • 6 comments

Hi, I like this project, but I need command LRANGE, I didn't find it..

hit9 avatar Jul 25 '14 05:07 hit9

It would also be cool if there were a way to set the value of a particular index.

coleifer avatar May 26 '15 05:05 coleifer

The HSET, HGET and related commands should perform the same job if you pass numbers instead of string as keys

symisc avatar May 26 '15 23:05 symisc

@symisc -- you mean just use a hash instead of the list type?

coleifer avatar May 27 '15 00:05 coleifer

I'm talking about setting a value of a particular index which may appy to an associative array or hash but I agree that the list commands should be available.

symisc avatar May 27 '15 00:05 symisc

@symisc -- I apologize but I don't think I follow. If I have a list of values (created by appending multiple values with LPUSH), I can use LINDEX to get the value stored at a given index. However I am not able to use HGET or HSET to access or modify the values in the list.

coleifer avatar May 27 '15 01:05 coleifer

@coleifer Ah ok, you are right, it cannot be done using HSET and stuff but it should be easy to implement since vedis uses internally a hybrid datastructure named hashmap which act as a hashtable and a linked list at the same time and since lists entries have automatically assigned indexes, acces to the item should be O(1).

symisc avatar May 27 '15 01:05 symisc