mongolitedt

Build Status CRAN_Status_Badge CRAN RStudio mirror downloads Github Stars

Extends mongolite with finddt() and aggregatedt() that return data.table objects.

finddt and aggregatedt are faster implementations of mongolite::find and mongolite::aggregate.

Important

To use these functions the query sent to mongodb should return data that can be coerced into a data.table (using data.table::rbindlist). If not, the queries will return an error.

Examples

See vignettes for detailed exampels

Define a mongolite::mongo connection object

Then call bind_mongolitedt(mongo) to bind the finddt() and aggregatedt() functions

Then use the functions as you would standard mongolite functions:

mongo <- mongolite::mongo(collection = "test", db = "test", url = "mongodb://localhost")
bind_mongolitedt(mongo)

## return 10 rows of a data.table
mongo$finddt(limit = 10)

some quick benchmarks:

Installation

### install development version from github
devtools::install_github("SymbolixAU/mongolitedt")


SymbolixAU/mongolitedt documentation built on May 9, 2019, 3:30 p.m.