Permalink
Browse files

added supported CF versions to readme

  • Loading branch information...
1 parent ed7136e commit c3496bdc0d640ebe17848b6fcd039fe2f9088b98 @marcesher marcesher committed Jan 14, 2011
Showing with 14 additions and 0 deletions.
  1. +2 −0 README.textile
  2. +2 −0 core/Mongo.cfc
  3. +10 −0 test/scratch.cfm
View
@@ -2,6 +2,8 @@ h1. CFMongoDB
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+
+
h2. Some Code
One of the most appealing aspects is that data can be created as a ColdFusion structure and persisted almost verbatim. Example:
View
@@ -32,6 +32,8 @@
variables.mongo.init(variables.mongoConfig.getServers());
} else {
var _server = mongoConfig.getServers()[1];
+ writeDump(_server);
+ writeoutput(_server.getHost()); writeOutput(_server.getPort());
variables.mongo.init( _server.getHost(), _server.getPort() );
}
View
@@ -0,0 +1,10 @@
+<cfset javaloaderFactory = createObject('component','cfmongodb.core.JavaloaderFactory').init()>
+<cfset mongoConfig =
+createObject('component','cfmongodb.core.MongoConfig').init([{serverName='flame.mongohq.com',serverPort='27046'}],'timber', javaloaderFactory)>
+<cfset mongoConfig =
+createObject('component','cfmongodb.core.MongoConfig').init([{serverName='localhost',serverPort='27017'}],'timber', javaloaderFactory)>
+<cfset mongoConfig.setAuthDetails('user@some.com','xxxxxx')>
+<cfset mongo =
+createObject('component','cfmongodb.core.Mongo').init(mongoConfig)>
+
+<cfdump var="#mongo#">

0 comments on commit c3496bd

Please sign in to comment.