Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add missing redisZCount command #17

Merged
merged 4 commits into from

2 participants

@eddelbuettel

Brian, I am slowly becoming an ever-bigger Redis fanboy. We are using sorted sets a bit, and I noticed that ZCount was missing (and yes, I know about the very clever redisCmd). But the addition was so simple, so here it is.
Cheers, Dirk

@bwlewis bwlewis merged commit da97dc7 into bwlewis:master
@bwlewis
Owner

Thanks, Dirk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
4 DESCRIPTION
@@ -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
7 R/zsetVal.R
@@ -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
38 man/redisZCount.Rd
@@ -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
1  src/libsock.c
@@ -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];
Something went wrong with that request. Please try again.