CNUB logo Huntington Xavier University
Family Dollar
McDonald's
UDF Dairy Farmers Kroger groceries American Telegraph and Telephone WEBN home page

Page History: rmongodb - R Driver for MongoDB

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2011/09/06 03:51


rmongodb, a client driver for the R language to MongoDB, was developed with help from 10Gen, Inc.

The full reference manual is available here: rmongodb.pdf

The source code for this driver is now publicly available at GitHub here: https://github.com/gerald-lindsly/rmongodb.

Plans are to submit the driver to the Comprehensive R Archive Network (CRAN) for pre-built distribution soon.

Contact Info

Please contact me at if you have comments, issues or bug reports concerning the driver.

Wish List

Under consideration is adding to the append functions support for the dim attribute. Currently the only ways to handle multidimensional arrays is either with mongo.bson.buffer.append.object() or by user code that sets dim itself. What I want to do with this wish is output prettier BSON that is not encumbered by the R_OBJ wrapper (nor a call to ...append.object()). A two dimensional array would look like this, for example:

{
  idmat3D : [
              [ 1, 0, 0 ],
              [ 0, 1, 0 ],
              [ 0, 0, 1 ]
            ]
}

In conjunction with this, mongo.bson.value(), mongo.bson.iterator.value(), and mongo.bson.to.list() would have code added to them to do look ahead parsing of the input BSON to see if an element looks like a multidimensional array. All components would have to be of the same atomic type and all rows (or depth's, etc.) would have to be of the same length.

Let me know via email if you would like to see this wish implemented.

News

2011-09-05: I added mongo.bson.buffer.append.object() last night. This allows higher level R objects to be stored in the database without loss of attributes (such as their class). The other 'append' functions lose most attributes as they are primarily targeted towards storing single values (or vectors of them). These do support the 'names' attribute as this fitted in naturally with BSON. mongo.bson.buffer.append.object() puts a wrapper around an object's lower level value which can be detected by mongo.bson.value(), mongo.bson.iterator.value and mongo.bson.to.list(). See the docs for more information: rmongodb.pdf.