Skip to content

Commit

Permalink
Add :store option to SORT command
Browse files Browse the repository at this point in the history
  • Loading branch information
ragnard committed Mar 15, 2010
1 parent cb9cc61 commit 38959dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/redis/internal.clj
Expand Up @@ -203,6 +203,9 @@
:get (let [pattern (first args)]
(recur (conj arg-strings "GET" pattern)
(rest args)))
:store (let [key (first args)]
(recur (conj arg-strings "STORE" key)
(rest args)))
:alpha (recur (conj arg-strings "ALPHA") args)
:asc (recur (conj arg-strings "ASC") args)
:desc (recur (conj arg-strings "DESC") args)
Expand Down
4 changes: 3 additions & 1 deletion test/redis/tests.clj
Expand Up @@ -455,7 +455,9 @@
(is (= ["one" "two" "three" "four"]
(redis/sort "ids" :get "object_*")))
(is (= ["one" "two"]
(redis/sort "ids" :by "name_*" :alpha :limit 0 2 :desc :get "object_*"))))
(redis/sort "ids" :by "name_*" :alpha :limit 0 2 :desc :get "object_*")))
(redis/sort "ids" :by "name_*" :alpha :limit 0 2 :desc :get "object_*" :store "result")
(is (= ["one" "two"] (redis/lrange "result" 0 -1))))



Expand Down

0 comments on commit 38959dd

Please sign in to comment.