Hello,

I tried out the session caching to mongo DB today.   Incredibly Simple to
do.     Keep in mind that I have no touched Mongo DB before today so I have
not setup any security etc.

I downloaded the latest nightly from:  http://www.openbd.org/download/

I then downloaded mongodb and followed these steps to set it up as a
service:
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/

I then created an Application.cfc file:

<cfcomponent>

<cfset this.name = "myApplication">

// alternatively you can do this inside a cfscript block
<cfscript>
this.sessionmanagement = true;
this.clientmanagement = false;

this.sessionstorage = "mongo://localhost:27017";
</cfscript>

<cffunction name="onApplicationStart">
// your code to initialise the variables that will go in "application" scope
<cfset application.datasource = "myDatasource">
</cffunction>

<cffunction name="onRequestStart">
<cfargument name="requesturi" required="true"/>
</cffunction>

</cfcomponent>

I then created an index.cfm page:

<cfset session.randy=true>

<cfdump var="#SESSION#">

And that is all their is to it.

I was able to go into mongodb and see the openbd database and the
collections.


It is my understanding that no code changes need to be made to the code
base.  That is pretty darn cool.


Next up for me is going to be learning more about MongoDB and getting it
installed on linux and learning more about it in general.

Randy

-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

Reply via email to