Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MongoDB client wrapper for ColdFusion

branch: new-core

This branch is 0 commits ahead and 123 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 core
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .project
Octocat-spinner-32 Application.cfc
Octocat-spinner-32 README.textile
README.textile

CFMongoDB

CFMongoDB is both partial wrapper for the MongoDB Java driver and a document-object mapper for ColdFusion. Additionally, there’s a simple DSL which provides ColdFusion developers the ability to easily search MongoDB document collections.

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

<cfscript>

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

mongo.save(my_struct, col);

//query
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 = cursor.next();
  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 = #orc.name# <br>");
}

</cfscript>

Check out the wiki for additional info : http://wiki.github.com/virtix/cfmongodb/

Collaboration is welcome.

Something went wrong with that request. Please try again.