Skip to content

Commit

Permalink
removed quote wrappings in return value of dbAggregate and make it re…
Browse files Browse the repository at this point in the history
…turn a vector rather than string.
  • Loading branch information
jayjacobs committed Jan 15, 2013
1 parent d9cff0d commit ce3f837
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/rmongo.R
Expand Up @@ -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
}
)
3 changes: 1 addition & 2 deletions tests/RMongo-Ex.R
Expand Up @@ -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]))
}

Expand Down

0 comments on commit ce3f837

Please sign in to comment.