virtix / cfmongodb

MongoDB client wrapper for ColdFusion — Read more

This URL has Read+Write access

unknown (author)
Wed Dec 09 12:51:39 -0800 2009
README
10.18.2009 
bill shelton

This is simple proof of concept of using ColdFusion and MongoDB.

Conclusion: sweet

Description: Inserts CFML structs into MongoDB
Basic Usage:

mongo = createObject('component','MongoDB');

person = {
    name="bill",
    email = 'bill@mxunit.org',
    address = {
      street = '123 main st',
      city = 'anytown',
      state = 'here',
      zip = '12345',
      country = 'usa'
    },
  };

id = mongo.put(person);
person.city = 'some other town';
mongo.update(person);
fetched_person = mongo.get
  
mongo.delete(person); 

Installation:

1. Download and install MongoDB: http://www.mongodb.org/
2. Make sure mongod is running. The examples use MongoDB's defaults:
   server_name = 'localhost', server_port = 27017
3. Download the MongoDB Java Driver: http://github.com/mongodb/mongo-java-driver/downloads
4. Place the Java MongoDB Driver in your CF Server's classpath (some /lib somewhere)
5. Copy the CFMongoDB files to your web root; e.g, /cfmongo.
6. Start the server and point your browser to http://localhost:8888/cfmongo/demo.cfm

Notes: This was built and tested on Railo 3.1.1 Express and Ubuntu 9.04. Would like to
test this in other environments.