2012年3月26日星期一

Beats By Dre For SaleThis article introduces thesort order redis

This article introduces thesort order redis . Redis support for list ,set and sorted set element sort .Sort order is sort complete command & # 26684 ;type as follows :SORT key BY LIMIT start GET STORE following us one one to illustrate the various command options ( 1) sort key this is the simplest case ,there is no option is a simple to set their own sort and return to sort the results.
The following to the example ( 2 ) sort default sort order ( ASC ) is from small to big ,of course, can also be in accordance with the reverse or by the character sequence .
The reverse can be coupled with the desc option ,Beats By Dre Sale,to alphabetically can add alpha option ,Beats By Dre For Sale,of course,Five Fingers Shoes, alpha with desc .The following is an alphabetical examples of redis > ;Sadd Tom: friend: List 123 # Tom Are friends of the uid 1 redis > ;Sadd Tom: friend: list 4561 redis > ;Sadd Tom: friend: list 7891 redis > ;Sadd Tom: friend: List 1011 redis set > ;UID: sort: 1231000 UID OK redis # corresponding results of > ;set uid : sort: 4566000 OK redis > ;set uid : sort: 789100 OK redis > ;set uid : sort: 1015999 OK redis > ;set uid: 123 " ;{ :123 , : } " ;# increased uid corresponding OK redis > friends information ;set uid: 456 " ;{ :456 , :} " ;OK redis > ;set uid: 789 " ;{ :789 ,Beats By Dr. Dre, :} " ;OK redis > ;set uid: 101 " ;{ :101 , :} " ;OK redis > ;sort Tom: friend: list by uid: sort: * get uid: * # from the friends list to obtain ID and uid: sort field match after the sort ,and in accordance with the after the sort order ,use key uid table to obtain information in 1 { :789 , :} 2 { :123 , :} 3 { :101 , :} 4 { :456 , :} redis > ;sort Tom : friend: list by uid: sort: get uid: * get uid : sort: * 1 { :789 ,Dr Dre Beats, :} 2.
Related articles:

没有评论:

发表评论