Skip to content
Browse files

removed quote wrappings in return value of dbAggregate and make it re…

…turn a vector rather than string.
  • Loading branch information...
1 parent d9cff0d commit ce3f837aa2714a06b23f44d17186d0562c292468 @jayjacobs jayjacobs committed Jan 15, 2013
Showing with 2 additions and 3 deletions.
  1. +1 −1 R/rmongo.R
  2. +1 −2 tests/RMongo-Ex.R
View
2 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
}
)
View
3 tests/RMongo-Ex.R
@@ -101,15 +101,14 @@ 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)
# 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]))
}

0 comments on commit ce3f837

Please sign in to comment.
Something went wrong with that request. Please try again.