MongoDB client wrapper for ColdFusion
ColdFusion Java
Failed to load latest commit information.
core added supported CF versions to readme Jan 14, 2011
examples committing Aarons changes; also, cleaned up some unit tests; added da… Dec 21, 2010
lib updated to latest Java driver (2.4) Jan 14, 2011
.classpath updated to latest Java driver (2.4) Jan 14, 2011
.project Added $set to update; added more examples of update and $inc to getti… Nov 6, 2010
Application.cfc getting started on poc java extensions Oct 10, 2010
README.textile added supported CF versions to readme Jan 14, 2011
build.xml major changes: now using custom DBObjects and DBObjectBuilder to get … Oct 10, 2010



CFMongoDB is both partial wrapper for the MongoDB Java driver and a document-struct mapper for ColdFusion. It attempts to remove the need for constant javacasting in your CFML when working with MongoDB. Additionally, there’s a simple DSL which provides ColdFusion developers the ability to easily search MongoDB document collections.

CFMongoDB works with Adobe ColdFusion 9.0.1+ and Railo 3.2+

Some Code

One of the most appealing aspects is that data can be created as a ColdFusion structure and persisted almost verbatim. Example:


col = 'my_collection':
my_struct = {
  name = 'Orc #getTickCount()#'
  foo = 'bar'
  bar = 123
  'tags'=[ 'cool', 'distributed', 'fast' ]
};, col);

result = mongo.query(col).startsWith('name','Orc').search(limit=20);
writeOutput("Found #results.size()# of #results.totalCount()# Orcs");

//use the native mongo cursor. it is case sensitive!
cursor = result.asCursor();
while( cursor.hasNext() ){
  thisOrc =;
  writeOutput(" name = #thisOrc['name'] <br>");

//use a ColdFusion array of structs. this is not case sensitive
orcs = result.asArray();
for(orc in orcs){
  writeOutput(" name = <br>");


More Examples

See examples/gettingstarted.cfm to start.

Additional examples are in the various subdirectories in examples/

The Wiki

Check out the wiki for additional info:

Getting Help

We have a Google group:

Please limit conversations to MongoDB and ColdFusion. General MongoDB questions are best asked on the MongoDB group at

Posting Issues

Post issues to the github issue tracker for the project. Better: post fixes. Best: post fixes with unit tests.

Getting Involved

Collaboration is welcome. Fork — Commit — Request a pull. For bug fixes and feature additions, commits with unit tests are much more likely to be accepted.

Code well.