Skip to content
Jon Clausen edited this page Dec 20, 2015 · 12 revisions

MongoDB Module for Coldbox

CBMongoDB applies an Active Record to manage MongoDB documents and schema using a familiar syntax for CRUD operations, recordset processing and retrieval. It makes direct use of and provides a CFML interface to the Mongo 3.0 Java driver for advanced operations.

  • Compatibility: ColdFusion 9.0.1+/Lucee 4.2+ w/ Coldbox 4+
  • Module Version: 3.1.0.3 (Release Date: 12/12/2015)
  • Mongo Java Driver Version: 3.1.0
  • Compatibility Note: This module is no longer compatible with the CFMongoDB module, due to conflicting configuration keys.

Changelog:

Major Release v3.1.0:

  1. Removes Requirement For CFMongoDB Module
  2. Adds Requirement for CBJavaloader Module
  3. Implements MongoDB 3.0 Driver
  4. Implements the ability to use multiple databases
  5. Implements the ability to configure databases at the entity level
  6. Implements Native Collection Methods for the 3.0 MongoCollection
  7. Implements CFML Aggregation methods while allowing direct access to native driver methods
  8. Implements CFML Map-Reduce methods
  9. Demonstrates 52% reduction in query execution times and database operations from the previous version
  10. Implements handlers for API documentation (/cmbongodb/docs) and Unit Tests (/cbmongodb/tests)
  11. Fixes issue with near() GEOSpatial operations on Polygon objects
  12. Re-factors Test Suite to Require the Framework Context
  13. Adds an asJSON argument to find() and findAll() entity queries
  14. Encapsulates all Collection Result queries to provide the following delivery methods: .asResult() - MongoIterable, .asCursor() - MongoIterator, .asArray(), asJSON()

Patch v3.1.0.3:

  1. Fixes issue with connections not being pooled accurately and adds connection closing to module unload
  2. Moves module bindings to onLoad() to ensure availability of cbjavaloader module
  3. Changes return type of all single record retrievals inserts and updates to native structs and adds auto-stringification of _id (eliminates the need for toString())
  4. Ensures version of returned object from findOneAndUpdate/findOneAndReplace operations is the after-save version

Patch v3.1.0.4:

  1. Adds validation methods for entities and support for new property ForceValidation, which will not save documents which do not validate
  2. Adds auto-normalization capabilities for schema properties. When attributes are configured, schema will auto-normalize when set() and populate() methods are called.
  3. Implements full support for component accessors on all schema properties. Var safe accessor closures are generated to allow recursion through an underscore delimiter (e.g. getFirstLevel_SecondLevel() to retrieve getDocument().FirstLevel.SecondLevel)
  4. Fixes native CFML data types not being sanitized on deeply nested structs and arrays.
  5. Add getDocument() and asStruct() utility methods, which can be used on unloaded and unloaded entities.
  6. Adds append() and prepend() functions to assit in managing document schema arrays.
  7. Fixes issues with property maps not being defined correctly and correct casting of boolean property defaults.
  8. Adds MongoIndexer singleton to delegate index management away from Entity instances.