Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 71 lines (45 sloc) 2.265 kB
ff0c8e3 @marcesher updated readme
marcesher authored
1 h1. CFMongoDB
2
3 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.
4
c3496bd @marcesher added supported CF versions to readme
marcesher authored
5 CFMongoDB works with Adobe ColdFusion 9.0.1+ and Railo 3.2+
6
ff0c8e3 @marcesher updated readme
marcesher authored
7 h2. Some Code
8
9 One of the most appealing aspects is that data can be created as a ColdFusion structure and persisted almost verbatim. Example:
10
11 <pre>
12 <cfscript>
13
14 //save
15 col = 'my_collection':
16 my_struct = {
17 name = 'Orc #getTickCount()#'
18 foo = 'bar'
19 bar = 123
20 'tags'=[ 'cool', 'distributed', 'fast' ]
21 };
22
23 mongo.save(my_struct, col);
24
25 //query
26 result = mongo.query(col).startsWith('name','Orc').search(limit=20);
27 writeOutput("Found #results.size()# of #results.totalCount()# Orcs");
28
29 //use the native mongo cursor. it is case sensitive!
30 cursor = result.asCursor();
31 while( cursor.hasNext() ){
32 thisOrc = cursor.next();
33 writeOutput(" name = #thisOrc['name'] <br>");
34 }
35
36 //use a ColdFusion array of structs. this is not case sensitive
37 orcs = result.asArray();
38 for(orc in orcs){
39 writeOutput(" name = #orc.name# <br>");
40 }
41
42 </cfscript>
43 </pre>
44
45 h2. More Examples
46
47 See examples/gettingstarted.cfm to start.
48
5d3be2f @marcesher updated readme
marcesher authored
49 Additional examples are in the various subdirectories in examples/
50
ff0c8e3 @marcesher updated readme
marcesher authored
51 h2. The Wiki
52
8025d47 @marcesher updated readme with link to mongodb-user
marcesher authored
53 Check out the wiki for additional info: "http://wiki.github.com/marcesher/cfmongodb/":http://wiki.github.com/marcesher/cfmongodb/
ff0c8e3 @marcesher updated readme
marcesher authored
54
55 h2. Getting Help
56
57 We have a Google group: "http://groups.google.com/group/cfmongodb":http://groups.google.com/group/cfmongodb
58
8025d47 @marcesher updated readme with link to mongodb-user
marcesher authored
59 Please limit conversations to MongoDB and ColdFusion. General MongoDB questions are best asked on the MongoDB group at "http://groups.google.com/group/mongodb-user":http://groups.google.com/group/mongodb-user
60
ff0c8e3 @marcesher updated readme
marcesher authored
61 h2. Posting Issues
62
63 Post issues to the github issue tracker for the project. Better: post fixes. Best: post fixes with unit tests.
64
65 h2. Getting Involved
66
8025d47 @marcesher updated readme with link to mongodb-user
marcesher authored
67 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.
ff0c8e3 @marcesher updated readme
marcesher authored
68
69 Code well.
70
Something went wrong with that request. Please try again.