1 package com.redis.operations
4 * Redis sort operations
10 def getConnection(key: String): Connection
13 // Sort a Set or a List accordingly to the specified parameters.
14 def sort(args: Any): List[String] = args match {
15 case (key: String, command: String) => doSort(key, command)
16 case (key: String) => doSort(key, "")
19 def doSort(key: String, command: String): List[String] = {
20 val connection = getConnection(key)
22 connection.write("SORT "+key+" "+command+"\r\n")
24 connection.write("SORT "+key+"\r\n")