From ce3f837aa2714a06b23f44d17186d0562c292468 Mon Sep 17 00:00:00 2001 From: jayjacobs Date: Tue, 15 Jan 2013 09:10:16 -0600 Subject: [PATCH] removed quote wrappings in return value of dbAggregate and make it return a vector rather than string. --- R/rmongo.R | 2 +- tests/RMongo-Ex.R | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/R/rmongo.R b/R/rmongo.R index 67b2409..87cd490 100644 --- a/R/rmongo.R +++ b/R/rmongo.R @@ -108,7 +108,7 @@ setMethod("dbGetDistinct", signature(rmongo.object="RMongo", collection="charact setGeneric("dbAggregate", function(rmongo.object, collection, query="") standardGeneric("dbAggregate")) setMethod("dbAggregate", signature(rmongo.object="RMongo", collection="character", query="character"), function(rmongo.object, collection, query){ - results <- .jcall(rmongo.object@javaMongo, "S", "dbAggregate", collection, .jarray(query)) + results <- .jcall(rmongo.object@javaMongo, "[S", "dbAggregate", collection, .jarray(query)) results } ) diff --git a/tests/RMongo-Ex.R b/tests/RMongo-Ex.R index d991d2c..53d4ffd 100644 --- a/tests/RMongo-Ex.R +++ b/tests/RMongo-Ex.R @@ -101,7 +101,6 @@ test.dbAggregate <- function(){ output <- dbAggregate(mongo, "test_data", c(' { "$project" : { "baz" : "$foo" } } ', ' { "$group" : { "_id" : "$baz" } } ', - #' { "$group" : { "_id" : "$baz" } } ')) ' { "$match" : { "_id" : "bar" } } ')) dbRemoveQuery(mongo, "test_data", '{}') dbDisconnect(mongo) @@ -109,7 +108,7 @@ test.dbAggregate <- function(){ # print(length(output)) print(as.character(output[1])) - checkEquals("\"{ \"_id\" : \"bar\"}\"", as.character(output[1])) + checkEquals("{ \"_id\" : \"bar\"}", as.character(output[1])) # checkEquals("bar", as.character(output[1])) }