Fast and Simple 'MongoDB' Client for R

High-performance MongoDB client based on 'mongo-c-driver' and 'jsonlite'. Includes support for aggregation, indexing, map-reduce, streaming, encryption, enterprise authentication, and GridFS. The online user manual provides an overview of the available methods in the package: <>.



  • Update vendored mongo-c-driver to v1.4.0
  • MacOS now defaults to OSX native secure transport SSL instead of openssl


  • Try to fix CRAN build on MacOS (CRAN builder has broken openssl)


  • Fix some rchk false positives because cran


  • Stable GridFS support!
  • Lazy connection pooling: automatically re-use existing connections
  • Update mongo-c-driver to upstream 1.12.0
  • Switch json export to new "relaxed extended json" format
  • Fixed a bug in libmongoc srv lookup on Windows
  • Compiler warnings for GCC 8
  • Fixed bson spec unit tests (Aaron Jacobs)
  • mongo$drop() now returns FALSE instead of error if collection does not exist
  • Added m$disconnect() method, with some internal refactoring
  • m$aggregate() gains an iterate parameter
  • m$export() gains query, field and sort parameters
  • Switch to in examples


  • Update mongo-c-driver to upstream 1.9.2
  • Expose a run() method to execute commands
  • Collection and cursor pointers now protect parent from GC
  • Make internal functions static
  • interate object gains a json() method
  • Experimental GridFS support


  • Change default value of 'filters' to NULL for MongoDB < 3.4
  • Added a new method mongo$replace() for fixed value updates


  • Fix protect bug introduced while trying to fix rchk
  • Merge final upstream 1.9.0 release


  • Update mongo-c-driver to upstream 1.9.0
  • Switch from uptream deprecated APIs to new ones
  • Add 'filter' parameter to mongo$update() for arrayFilters
  • Expose 'stop_on_error' parameter in mongo$insert()
  • Updated mongo$update() to new APIs and return summary reply
  • Workaround #pragma lines in vendored mongo-c-driver for CRAN


  • Update mongo-c-driver to upstream 1.6.2
  • Update jsonlite requirement to 1.4 (fixes bug in reading dates)
  • Add 'date_as_char' parameter to mongo_options()


  • Update mongo-c-driver to upstream 1.6.1
  • Fix "-Wempty-translation-unit" compiler warning on OSX
  • Extract autobrew script


  • New mongo bookdown docs at
  • Update mongo-c-driver to upstream 1.6.0
  • Add basic decimal 128 support (coerce to double)
  • Improve enterprise authentication for LDAP, X509 and Kerberos
  • Windows: build with SSPI instead of SASL
  • Added 'allow_invalid_hostname' parameter to ssl_options()
  • Option 'bigint_as_char' to parse int64 into string instead of double
  • New function mongo_options to get/set global options
  • Function mongo_log_level is removed (use mongo_options instead)
  • insert() now substitutes dots in key (col) names with underscores
  • Various fixes in update(), support for upsert
  • Add unit tests from 'specifications' (some tests fail in mongo-c-driver)
  • Switch to new C driver API mongoc_collection_find_with_opts()
  • Add R_registerRoutines() call to please CMD check


  • Upgrade mongo-c-driver to upstream 1.5.1


  • Add 'ssl_options()' funtion and 'options' parameter for SSL connections


  • Update mongo-c-driver to 1.4.1 (Still use OpenSSL on all platforms)
  • Fix configure script for new Homebrew
  • BREAKING: ObjectID fields are now returned as strings instead of raw vectors
  • Use new 'always_decimal' option in jsonlite to keep real numbers as doubles
  • Make 'mongo' objects serializable (persistent between R sessions)
  • New function 'mongo_log_level' to set debugging verbosity
  • Add 'list' and 'json' support for m$insert()
  • Add option to disable query timeout for count(), find(), aggregate()
  • Disable DBSON_EXTRA_ALIGN when UBSAN is enabled


  • Update mongo-c-driver to 1.3.4


  • Update mongo-c-driver to 1.3.1
  • Fix for snow leopard (no strnlen)


  • Added mongolabs example that runs with R CMD check
  • Update mongo-c-driver to 1.3.0
  • Link to OpenSSL 1.0.2d on Windows
  • Backport workaround GNU extension in mongoc-util-private.h:34
  • Link to brew openssl 1.0.2 on OSX instead of native 0.9.8


  • Update mongo-c-driver to db120a3526
  • Workaround GNU extension in mongoc-util-private.h:34
  • Fix for m$export() on windows (UTF8 related)
  • Fix for setInternet2 in R 3.3.0 on Windows


  • Update mongo-c-driver and libbson to 1.1.10
  • New method 'iterate' to retrieve records without simplification
  • POSIXt timestamps and raw vectors are inserted as native types
  • Fix for authentication to database specified in the 'url'


  • Add support for export() and import()
  • Update mongo-c-driver and libbson to 1.1.7
  • Make 'verbose' parameter global


  • Update mongo-c-driver and libbson to 1.1.5
  • Add support for map-reduce


  • Initial release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.4.1 by Jeroen Ooms, a month ago (devel) (user manual) (upstream)

Report a bug at

Browse source code at

Authors: Jeroen Ooms [aut, cre] , MongoDB , Inc [cph] (Bundled mongo-c-driver , see AUTHORS file)

Documentation:   PDF Manual  

Task views: Databases with R

Apache License 2.0 license

Imports jsonlite, openssl, mime

Suggests spelling, nycflights13, ggplot2

System requirements: OpenSSL, Cyrus SASL (aka libsasl2)

Imported by CEDARS, epos, nodbi, rtsdata.

Suggested by AzureCosmosR, OpenSpecy, ctrdata, mongopipe, resourcer, ssh, vkR.

See at CRAN