Rediska

Follow me on twitter…

Sorted sets

AddToSortedSet

<?php

/**
 * Add member to sorted set
 * 
 * @param string $name  Key name
 * @param mixin  $value Member
 * @param number $score Score of member
 * @return boolean
 */

?>

DeleteFromSortedSet

<?php

/**
 * Add the specified member to the Set value at key
 * 
 * @param string $name  Key name
 * @param mixin  $value Member
 * @return boolean
 */

?>

GetSortedSet

<?php

/**
 * Get all the members of the Sorted Set value at key
 * 
 * @throws Rediska_Command_Exception
 * @param string  $name        Key name
 * @param integer $withScores  Return values with scores
 * @param integer $start       Start index
 * @param integer $end         End index
 * @param boolean $revert      Revert elements (not used in sorting)
 * @return array
 */

?>

GetSortedSetLength

<?php

/**
 * Get length of Sorted Set
 * 
 * @param string $name Key name
 * @return integer
 */

?>

GetFromSortedSetByScore

<?php

/**
 * Get members from sorted set by min and max score
 * 
 * @throws Rediska_Command_Exception
 * @param string  $name       Key name
 * @param number  $min        Min score
 * @param number  $max        Max score
 * @param boolean $withScores Get with scores
 * @param integer $limit      Limit
 * @param integer $offset     Offset
 * @return array
 */

?>

IncrementScoreInSortedSet

<?php

/**
 * Increment score of sorted set element
 * 
 * @param string $name  Key name
 * @param mixin  $value Member
 * @param number $score Score to increment
 * @return integer
 */

?>

DeleteFromSortedSetByScore

<?php

/**
 * Remove all the elements in the sorted set at key with a score between min and max (including elements with score equal to min or max).
 * 
 * @param string  $name  Key name
 * @param numeric $min   Min value
 * @param numeric $max   Max value
 * @return integer
 */

?>

DeleteFromSortedSetByRank

<?php

/**
 * Remove all elements in the sorted set at key with rank between start  and end
 * 
 * @param string  $name  Key name
 * @param numeric $start Start position
 * @param numeric $end   End position
 * @return integer
 */

?>

GetScoreFromSortedSet

<?php

/**
 * Get member score from Sorted Set
 * 
 * @param string $name
 * @param mixin $value
 * @return number
 */

?>

GetRankFromSortedSet

<?php

/**
 * Get rank of member from sorted set
 * 
 * @param string  $name   Key name
 * @param integer $value  Member value
 * @param boolean $revert Revert elements (not used in sorting)
 * @return integer
 */

?>

UnionSortedSets

<?php

/**
 * Store to key union between the sorted sets
 * 
 * @param array  $names       Array of key names or associative array with weights
 * @param string $storeName   Result sorted set key name
 * @param string $aggregation Aggregation method: SUM (for default), MIN, MAX.
 * @return integer
 */

?>

IntersectSortedSets

<?php

/**
 * Store to key intersection between sorted sets
 * 
 * @param array  $names       Array of key names or associative array with weights
 * @param string $storeName   Result sorted set key name
 * @param string $aggregation Aggregation method: SUM (for default), MIN, MAX.
 * @return integer
 */

?>

Sort

<?php

/**
 * Get sorted elements contained in the List, Set, or Sorted Set value at key.
 * 
 * @param string        $name  Key name
 * @param string|array  $value Options or SORT query string (http://code.google.com/p/redis/wiki/SortCommand).
 *                             Important notes for SORT query string:
 *                                 1. If you set Rediska namespace option don't forget add it to key names.
 *                                 2. If you use more then one connection to Redis servers, it will choose by key name,
 *                                    and key by you pattern's may not present on it.
 * @return array
 */

?>

Comments