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])) }