Permalink
Browse files

Merge pull request #17 from eddelbuettel/master

add missing redisZCount command
  • Loading branch information...
2 parents 98bdaad + 17d4254 commit da97dc7a622471d09f1d7d70bda2a2d939603eb2 @bwlewis committed Jan 6, 2014
Showing with 47 additions and 3 deletions.
  1. +2 −2 DESCRIPTION
  2. +7 −0 R/zsetVal.R
  3. +38 −0 man/redisZCount.Rd
  4. +0 −1 src/libsock.c
View
@@ -1,8 +1,8 @@
Package: rredis
Type: Package
Title: Redis client for R
-Version: 1.6.8
-Date: 2013-09-16
+Version: 1.6.8.1
+Date: 2014-01-05
Author: B. W. Lewis
Maintainer: B. W. Lewis <blewis@illposed.net>
Description: An R client for the Redis persistent key-value database available from http://redis.io.
View
@@ -75,6 +75,13 @@ redisZRemRangeByScore <- function(key, min, max)
.redisCmd(.raw('ZREMRANGEBYSCORE'), .raw(key), .raw(min), .raw(max))
}
+redisZCount <- function(key, min, max)
+{
+ min <- as.character(min)
+ max <- as.character(max)
+ .redisCmd(.raw('ZCOUNT'), .raw(key), .raw(min), .raw(max))
+}
+
redisZCard <- function(key)
{
.redisCmd(.raw('ZCARD'), .raw(key))
View
@@ -0,0 +1,38 @@
+\name{redisZCount}
+\alias{redisZCount}
+%- Also NEED an '\alias' for EACH other topic documented here.
+\title{
+redisZCount
+}
+\description{
+Returns the number of elements in the sorted set at key with a score between min and max.
+The min and max arguments have the same semantic as described for \code{redisZRangeByScore}.
+}
+\usage{
+redisZCount(key, min, max)
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+ \item{key}{
+The set name.
+}
+ \item{min}{
+Minimum score.
+}
+ \item{max}{
+Maximum score.
+}
+}
+\value{
+See the Redis documentation for more information.
+%% If it is a LIST, use
+%% \item{comp1 }{Description of 'comp1'}
+%% \item{comp2 }{Description of 'comp2'}
+%% ...
+}
+\references{
+http://redis.io/commands
+}
+\author{
+B. W. Lewis
+}
View
@@ -24,7 +24,6 @@
*/
SEXP SOCK_NAGLE(SEXP S, SEXP VAL)
{
- SEXP ans = R_NilValue;
int val = INTEGER(VAL)[0];
#ifdef WIN32
SOCKET s = (SOCKET)INTEGER(S)[0];

0 comments on commit da97dc7

Please sign in to comment.