Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merging

  • Loading branch information...
commit 8d428cb4c76a16f15366720a82f47c784b84a191 2 parents fa05a70 + 55e861e
bill shelton authored
Showing with 631 additions and 361 deletions.
  1. +1 −0  .gitignore
  2. +16 −0 .project
  3. +84 −2 components/Collection.cfc
  4. +12 −7 components/Database.cfc
  5. +67 −0 components/Document.cfc
  6. +31 −29 components/ExpressionBuilder.cfc
  7. +35 −0 components/MongoBase.cfc
  8. +3 −4 components/MongoConfig.cfc
  9. +91 −204 components/MongoDB.cfc
  10. +13 −12 components/MongoDocument.cfc
  11. +10 −0 test/BaseTestCase.cfc
  12. +38 −0 test/ConfirmSetupTest.cfc
  13. +45 −0 test/MongoBaseTest.cfc
  14. +21 −97 test/MongoDBTest.cfc
  15. +8 −0 test/MongoTest.cfc
  16. 0  test/{ → orig}/BaseTest.cfc
  17. +6 −6 test/{ → orig}/CollectionEachIteratorTest.cfc
  18. 0  test/{ → orig}/DatabaseTest.cfc
  19. 0  test/{ → orig}/DocumentFactoryModelTest.cfc
  20. 0  test/{ → orig}/DocumentTest.cfc
  21. 0  test/{ → orig}/ExpressionBuilderTest.cfc
  22. 0  test/{ → orig}/InheritedDocumentTest.cfc
  23. 0  test/{ → orig}/IntrospectionTest.cfc
  24. 0  test/{ → orig}/ModelTest.cfc
  25. +150 −0 test/orig/MongoDBTest.cfc
  26. 0  test/{ → orig}/MongoSmokeTest.cfc
  27. 0  test/{ → orig}/NewDocumentTest.cfc
  28. 0  test/{ → orig}/SearchMongoTest.cfc
  29. 0  test/{ → orig}/SomeDoc.cfc
  30. 0  test/{ → orig}/TestSuiteTest.cfc
View
1  .gitignore
@@ -0,0 +1 @@
+/settings.xml
View
16 .project
@@ -1,3 +1,4 @@
+<<<<<<< HEAD:.project
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cfmongodb</name>
@@ -9,3 +10,18 @@
<natures>
</natures>
</projectDescription>
+=======
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>cfmongodb</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.ide.coldfusion.projectNature</nature>
+ <nature>org.cfeclipse.cfml.CFENature</nature>
+ </natures>
+</projectDescription>
+>>>>>>> 55e861e72919aa660874119e751de4e0fd3730b3:.project
View
86 components/Collection.cfc
@@ -1,8 +1,90 @@
-<cfcomponent output="false" hint="Represents a Mongo Collection">
+<cfcomponent extends="MongoBase" output="false" hint="Represents a Mongo Collection">
+
+
+
<!---
Operations on Collections:
--->
-<cffunction name="init" hint="Constructor"></cffunction>
+
+ <cfscript>
+ //if you don't init, you must quit (coding, that is)
+ function init(mongo,dbName,collectionName){
+ variables.mongo = arguments.mongo;
+ variables.db = mongo.getDb(dbName);
+ variables.collection = variables.db.getCollection(collectionName);
+ return this;
+ }
+
+
+ // !!! Find !!!!
+
+ function findOne(field="",value=""){
+ var query = newDBObject(field,value);
+ if(field eq ""){
+ query = newDBObjectFromStruct({});
+ }
+ return collection.findOne(query);
+ }
+
+
+ //when only a string id is available
+ function findById(id){
+ var objId = newIDCriteriaObject(id);
+ return findOne("_id", objId,dbName,collectionName);
+ }
+
+ function findAll(){
+ var sort = {pub_date = -1}; // TODO: figure out wtf this is
+ var sort_spec = newDBObjectFromStruct(sort);
+ return collection.find().sort( sort_spec ).toArray();
+ }
+
+ function count(){
+ return collection.getCount();
+ }
+
+ // !!! Insert and Upsert !!!
+ function insert(structure){
+ var doc = newDBObjectFromStruct(structure);
+ var id = chr(0);
+ collection.insert(doc);
+ id = doc.get("_id");
+ structure._id = id; //add the _id object to the struct
+ return id;
+ }
+
+ function update(structure){
+ var newObject = newDBObjectFromStruct(structure);
+ if(structKeyExists(structure,"_id")){
+ critera = newIDCriteriaObject(structure._id);
+ return collection.update(criteria, newObject, true, false);
+ }else{
+ return collection.insert(newObject);
+ }
+ }
+
+
+
+ // !!! Remove !!!
+
+ function remove(criteria){
+ var doc = newDBObjectFromStruct(criteria);
+ return collection.remove(doc);
+
+ }
+
+ //Note the ObjectId object. This creates an ObjectId from
+ //the string representation of
+
+ function removeById(id){
+ var objId = newIDCriteriaObject(id);
+ return collection.remove(objID); //id's of deleted items
+ }
+
+
+
+ </cfscript>
+
</cfcomponent>
View
19 components/Database.cfc
@@ -1,5 +1,5 @@
-<cfcomponent output="false">
-<!---
+<cfcomponent extends="MongoBase" output="false">
+<!---
Operations on Databases:
set port
@@ -13,15 +13,20 @@ config = {
server_port = 27017,
db_name = 'default_db'
};
-
+
mongo = createObject('java', 'com.mongodb.Mongo').init( variables.config.server_name , variables.config.server_port );
-
- function getDB(name){
- return mongo.getDB(name);
+
+ function init(dbName){
+ variables.db = mongo.getDb(dbName);
+ return this;
+ }
+
+ function getCollection(collectionName){
+ return createObject("component","Collection").init(mongo,variables.db.getName(),collectionName);
}
</cfscript>
-<!---
+<!---
getAddress public com.mongodb.DBAddress com.mongodb.DBTCP.getAddress()
debugString public java.lang.String com.mongodb.DBTCP.debugString()
View
67 components/Document.cfc
@@ -0,0 +1,67 @@
+<cfcomponent extends="MongoBase" output="false" implements="IDocument" hint="Default implementation of IDocument and used by the Mongo class to generate a document.">
+
+<cfset this.__props__ = structNew() />
+<cfset variables.mongo = createObject('component', 'MongoDB') />
+
+
+<cffunction name="init" hint="Constructor. Creates an instance of a MongoDocument.">
+ <cfargument name="collection_name" type="string" required="true" hint="The name of the collection to which this document is bound." />
+ <cfargument name="_mongo" type="any" required="false" default="#variables.mongo#" hint="The instance of the Mongo wrapper to which the document is bound." />
+ <cfset variables.mongo.collection(collection_name) />
+ <cfset variables.mongo = _mongo />
+ <cfreturn this />
+</cffunction>
+
+
+<cffunction name="setCollection">
+</cffunction>
+
+
+<cffunction name="set" hint="Sets a property for the Document" returntype="void">
+ <cfargument name="property" type="String" />
+ <cfargument name="value" type="Any" />
+ <cfset structInsert(this.__props__, arguments.property, arguments.value) />
+</cffunction>
+
+
+<cffunction name="get" hint="Fetches the value of the given property. Returns null if not found." returntype="Any">
+ <cfargument name="property" />
+ <cfset var ret_val = javacast('null', '') />
+ <cftry>
+ <cfset ret_val = this.__props__[arguments.property] />
+ <cfcatch type="Expression">
+ <!--- want to return null --->
+ </cfcatch>
+ </cftry>
+ <cfreturn ret_val />
+</cffunction>
+
+<cffunction name="remove" returntype="void" hint="Removes a property form a Document. **NOT IMPLEMENTED**">
+ <cfargument name="property" hint="Removes the given property if it exists." />
+ <cfthrow type="NotImplementedException" message="To Do.">
+</cffunction>
+
+
+
+<cffunction name="save" returntype="String">
+ <cfreturn mongo.put(this.__props__) />
+</cffunction>
+
+
+<cffunction name="delete" returntype="void" hint="Deletes this Document from the Collection">
+ <cfset mongo.deleteById(this.__props__['_id']) />
+</cffunction>
+
+
+<cffunction name="update" hint="Performs in-place update of the the value for 'property'. NOT IMPLEMENTED">
+ <cfargument name="property">
+ <cfargument name="value">
+ <cfthrow type="NotImplementedException" message="To Do.">
+</cffunction>
+
+
+<cffunction name="validate" hint="Should be called before save() to perform any required validation. NOT IMPLEMENTED" returntype="void">
+ <cfthrow type="NotImplementedException" message="To Do.">
+</cffunction>
+
+</cfcomponent>
View
60 components/ExpressionBuilder.cfc
@@ -1,18 +1,18 @@
-<cfcomponent hint="Creates a Domain Specific Language (DSL) for querying MongoDB collections.">
+<cfcomponent extends="MongoBase">
<cfscript>
-
+
/*---------------------------------------------------------------------
-
- DSL for MongoDB searches:
-
+
+ DSL for MongoDB searches:
+
mongo.expressionBuilder().
-
+
results = mongo.startsWith('name','foo'). //string
endsWith('title','bar'). //string
exists('field','value'). //string
regex('field','value'). //string
eq('field','value'). //numeric
- lt('field','value'). //numeric
+ lt('field','value'). //numeric
gt('field','value'). //numeric
gte('field','value'). //numeric
lte('field','value'). //numeric
@@ -25,15 +25,31 @@
search('title,author,date', limit, start);
search(keys=[keys_to_return],limit=num,start=num);
-
-
-
+
+
+
-------------------------------------------------------------------------------------*/
builder = createObject('java', 'com.mongodb.BasicDBObjectBuilder').start();
pattern = createObject('java', 'java.util.regex.Pattern');
+function builder(){
+ return builder;
+}
+
+function start(){
+ builder.start();
+ return this;
+}
+
+function get(){
+ var g = builder.get();
+ start();//ensure we clear out any previous additions; otherwise, future queries with this same object would be screwy
+ return g;
+}
+
+
function startsWith(element, val){
var regex = val & '.*';
builder.add( element, pattern.compile(regex) );
@@ -61,20 +77,6 @@ function regex(element, val){
}
-function builder(){
- return builder;
-}
-
-function start(){
- builder.start();
- return this;
-}
-
-function get(){
- return builder.get();
-}
-
-
//May need at least some exception handling
function where( js_expression ){
builder.add( '$where', js_expression );
@@ -133,7 +135,7 @@ function $gte(element,val){
<cffunction name="before">
<cfargument name="element" type="string" />
<cfargument name="val" type="date" />
- <cfscript>
+ <cfscript>
var exp = {};
var date = parseDateTime(val);
exp['$lte'] = date;
@@ -146,7 +148,7 @@ function $gte(element,val){
<cffunction name="after">
<cfargument name="element" type="string" />
<cfargument name="val" type="date" />
- <cfscript>
+ <cfscript>
var exp = {};
var date = parseDateTime(val);
exp['$gte'] = date;
@@ -155,7 +157,7 @@ function $gte(element,val){
</cfscript>
</cffunction>
-<!---
+<!---
Note to self: Using cffunction here because of the ability/need to cast
arbitrary numeric data to java without using JavaCast. CFARGUMENT takes care
of that. CF9 might too, but most folks are still < CF9.
@@ -167,7 +169,7 @@ But, this also proved to be a very good refactor.
<cfargument name="element" type="string" hint="The element in the document we're searching"/>
<cfargument name="val" type="numeric" hint="The comparative value of the element" />
<cfargument name="type" type="string" hint="$gt,$lt,etc. The operators - <><=>= ..." />
- <cfscript>
+ <cfscript>
var exp = {};
exp[type] = val;
builder.add( element, exp );
@@ -179,7 +181,7 @@ But, this also proved to be a very good refactor.
<cfargument name="element" type="string" hint="The array element in the document we're searching"/>
<cfargument name="val" type="array" hint="The value(s) of an element in the array" />
<cfargument name="type" type="string" hint="$in,$nin,etc." />
- <cfscript>
+ <cfscript>
var exp = {};
exp[type] = val;
builder.add( element, exp );
View
35 components/MongoBase.cfc
@@ -0,0 +1,35 @@
+<cfcomponent>
+<cfscript>
+
+ /* OBJECT HELPER FUNCTIONS */
+ public function newDBObjectFromStruct(Struct data){
+ return createObject("java","com.mongodb.BasicDBObject").init(data);
+ }
+
+ public function newDBObject(String key, any value){
+ return createObject("java","com.mongodb.BasicDBObject").init(key,value);
+ }
+
+ public function newObjectIDFromID(String id){
+ return createObject("java","com.mongodb.ObjectId").init(id);
+ }
+
+ public function newIDCriteriaObject(String id){
+ return newDBObject("_id",newObjectIDFromID(id));
+ }
+
+ public struct function dbObjectToStruct(BasicDBObject){
+ var s = {};
+ s.putAll(BasicDBObject);
+ return s;
+ }
+
+ public function toJavaType(value){
+ if(not isNumeric(value) AND isBoolean(value)) return javacast("boolean",value);
+ if(isNumeric(value) and find(".",value)) return javacast("double",value);
+ if(isNumeric(value)) return javacast("int",value);
+ return value;
+ }
+
+</cfscript>
+</cfcomponent>
View
7 components/MongoConfig.cfc
@@ -1,13 +1,12 @@
-<cfcomponent output="false" hint="Main configuration information for MongoDb connections. Defaults are provided, but should be changed as needed. ">
+<cfcomponent extends="MongoBase" output="false" hint="Main configuration information for MongoDb connections. Defaults are provided, but should be changed as needed. ">
<cfscript>
- //To Do: Add various deployment environments: dev,test,stagging, production...
-
+
//Default values
this.defaults = {
server_name = 'localhost',
server_port = 27017,
db_name = 'default_db',
- collection_name = 'default_collection'
+ collection_name = 'default_collection'
};
</cfscript>
View
295 components/MongoDB.cfc
@@ -1,38 +1,68 @@
-<cfcomponent output="false" hint="Facade for Mongo DB. 90% of calls will go through this comonent.">
+<cfcomponent extends="MongoBase" output="false" hint="Facade for Mongo DB. 90% of calls will go through this component.">
<cfscript>
-config = createObject('component','MongoConfig');
+//This maybe should be a config object
+config = {
+ server_name = 'localhost',
+ server_port = 27017,
+ db_name = 'default_db',
+ collection_name = ''
+ };
+
-
//maybe this goes in super class? Or make factory for returning mongos
/*--------------------------------------------------------------------
- mongo1 = factory.createMongo(config);
---------------------------------------------------------------------*/
-mongo = createObject('java', 'com.mongodb.Mongo').init( config.defaults.server_name , config.defaults.server_port );
-db = mongo.getDb(config.defaults.db_name);
-collection = db.getCollection(config.defaults.collection_name);
-expression_builder = createObject('component', 'ExpressionBuilder') ;
-
+ mongo1 = factory.createMongo(config);
+--------------------------------------------------------------------*/
+mongo = createObject('java', 'com.mongodb.Mongo').init( variables.config.server_name , variables.config.server_port );
-//Starting to smell ...
function init(config){
- config.defaults = arguments.config;
- mongo = createObject('java', 'com.mongodb.Mongo').init( config.defaults.server_name , config.defaults.server_port );
- db = mongo.getDb(config.db_name);
- collection = db.getCollection(config.collection_name);
+ variables.config = arguments.config;
+ mongo = createObject('java', 'com.mongodb.Mongo').init( variables.config.server_name , variables.config.server_port );
return this;
}
+/**
+* Returns the java com.mongodb.Mongo object... with this, you can do anything available in the java API
+*/
+function getMongo(){
+ return mongo;
+}
-function config(){
+/**
+* Get a handle to a mongo db
+*/
+function getMongoDb(dbName="#variables.config.db_name#"){
+ return mongo.getDb(dbName);
+}
+/**
+* Get a handle to a mongo db's collection
+*/
+function getMongoCollection(dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return mongo.getDb(dbName).getCollection(collectionName);
}
+/**
+* Get a new cfmongodb Database object
+*/
+function db(String dbName){
+ return createObject("component","Database").init(dbName);
+}
+
+/**
+* Get a new cfmongodb Collection object
+*/
+function collection(String dbName, String collectionName){
+ return db(dbName).getCollection(collectionName);
+}
+
+
/*---------------------------------------------------------------------
-
- DSL for MongoDB searches:
-
- results = mongo.collection('blog').
+
+ DSL for MongoDB searches:
+
+ results = mongo.db('mydb').collection('blog').
startsWith('name','foo'). //string
endsWith('title','bar'). //string
exists('field','value'). //string
@@ -50,127 +80,85 @@ function config(){
search('title,author,date', limit, start);
search(keys=list_of_keys_to_return,sort={field=direction},limit=num,start=num);
-
-
-
+
+
+
-------------------------------------------------------------------------------------*/
-builder = createObject('component','ExpressionBuilder');
- // TO DO: loose the reference to duplicate(this)!!!
- // This has a bad smell ...
function new_doc(collection_name){
- var document = createObject('component','MongoDocument').factory_init( collection_name, duplicate(this) );
+ var document = createObject('component','MongoDocument').factory_init( collection_name, this );
return document;
}
-//Returns a document object based on the model
-function build_doc(model){
- var document = createObject('component','MongoDocument');
- document.model = model;
- return document;
-}
+// The following functions are all conveniences for the most-common operations; they wrap around
+//the "proper" Collection methods.
-function getMongo(){
- return mongo;
-}
-//------------------------------------------------------------------------//
-function add(key,value,o){
- //add key value pair to object ... todo
-}
+
+/* !!!!!!!!!!!!!! Inserts and Upserts !!!!!!!!!!!!!!!!!!! */
/**
-* @param o string
+* @param structure
*/
-function put(o){
- var doc = createObject('java', 'com.mongodb.BasicDBObject');
- var id = '';
- doc.putAll(o);
- id = collection.insert(doc).get("_id");
- o._id = id; //add the _id object to the struct
- return id;
+function insert(structure,dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return collection(dbName,collectionName)
+ .insert(structure);
}//end function
+function update(structure,dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return collection(dbName,collectionName)
+ .update(structure);
-function get(field,value){
- var q = createObject('java', 'com.mongodb.BasicDBObject').init(field,value);
- var cursor = collection.find(q);
- return cursor.next();
} //end function
-//when only a string id is available
-function getById(id){
- var str_id = id;
- var objId = chr(0);
- if(isObject(id)) str_id = id.toString();
- obj_id = createObject('java','com.mongodb.ObjectId').init(str_id);
- return get("_id", obj_id);
- } //en
+/*!!!!!!!!!!!!!!!!! Find !!!!!!!!!!!!!! */
-function count(){
- return collection.getCount();
-}
+function findOne(field="",value="",dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return collection(dbName,collectionName).findOne(field,value);
+} //end function
-function findOne(){
- return collection.findOne();
-} //
+//when only a string id is available
+function findById(id,dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ var objId = newIDCriteriaObject(id);
+ return findOne("_id", objId,dbName,collectionName);
+ } //end function
-function findAll(){
+function findAll(dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
var sort = {pub_date = -1};
- var sort_spec = createObject('java', 'com.mongodb.BasicDBObject').init(sort);
- return collection.find().sort( sort_spec ).toArray();
+ var sort_spec = newDBObjectFromStruct(sort);
+ return collection(dbName,collectionName).find().sort( sort_spec ).toArray();
} //end function
+function count(dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return collection(dbName,collectionName).getCount();
+}
-function delete(o){
- var obj = get("_id", o._id);
- return collection.remove(obj); //id's of deleted items
-} //end function
-//Note the ObjectId object. This creates an ObjectId from
-//the string representation of
-function deleteById(id){
- var objId = createObject('java','com.mongodb.ObjectId').init(id);
- var obj = get("_id", objId);
- return collection.remove(obj); //id's of deleted items
-} //en
-
-
-function update(o){
- var obj = getById( o._id);
- var new_object = createObject('java', 'com.mongodb.BasicDBObject').init(o);
- return collection.update(obj, new_object, false, false);
-
-} //end function
+/* !!!!!!!!!!!!!!! Remove !!!!!!!!!!!!!!!!!!!!*/
-//swtich to or create database
-function getDB(db_name){
- variables.db = mongo.getDb(db_name);
- db = mongo.getDb(db_name);
- return db;
-}
-
+function remove(structure,dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ var dbo = newDBObjectFromStruct(arguments.structure);
-//switch to or create collection
-function getCollection(collection_name){
- collection = db.getCollection(collection_name);
- return collection;
+ return collection(dbName,collectionName)
+ .remove(dbo);
}
-function collection(collection_name){
- collection = db.getCollection(collection_name);
- return this;
+//Note the ObjectId object. This creates an ObjectId from
+//the string representation of
+
+function removeById(id,dbName="#variables.config.db_name#",collectionName="#variables.config.collection_name#"){
+ return collection(dbName,collectionName).remove(id); //id's of deleted items
}
@@ -184,107 +172,6 @@ function listToStruct(list){
return s;
}
-
-
-function dbRef(collection_name, id){
- return createObject('java','com.mongodb.DBRef').init( db, collection_name, id);
-}
-
-/*---------------------------------------------------------
- Expression Builder Wrappers
- ---------------------------------------------------------*/
-
-function startsWith(element, val){
- expression_builder.startsWith(element, val);
- return this;
-}
-
-function endsWith(element, val){
- expression_builder.endsWith(element, val);
- return this;
-}
-
-
-function exists(element, val){
- var regex = '.*' & val & '.*';
- expression_builder.exists( element, regex );
- return this;
-}
-
-function regex(element, val){
- var regex = val;
- expression_builder.regex( element, regex );
- return this;
-}
-
-function where( js_expression ){
- expression_builder.where( js_expression );
- return this;
-}
-
-function inArray(element, val){
- expression_builder.inArray( element, val );
- return this;
-}
-
- //vals should be list or array
-function $in(element,vals){
- expression_builder.$in(element,vals);
- return this;
-}
-
-function $nin(element,vals){
- expression_builder.$in(element,vals);
- return this;
-}
-
-
-function $eq(element,val){
- expression_builder.$eq(element,val);
- return this;
-}
-
-
-function $ne(element,val){
- expression_builder.$ne(element,val);
- return this;
-}
-
-
-function $lt(element,val){
- expression_builder.$lt(element,val);
- return this;
- }
-
-
-function $lte(element,val){
- expression_builder.$lte(element,val);
- return this;
-}
-
-
-function $gt(element,val){
- expression_builder.$gt(element,val);
- return this;
-}
-
-
-function $gte(element,val){
- expression_builder.$gte(element,val);
- return this;
-}
-
-function before(element,val){
- expression_builder.before(element,val);
- return this;
-}
-
-function after(element,val){
- expression_builder.after(element,val);
- return this;
-}
-
-
</cfscript>
@@ -296,7 +183,7 @@ function after(element,val){
var key_exp = listToStruct(arguments.keys);
var _keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
var search_results = [];
- var criteria = expression_builder.get();
+ var criteria = expression_builder.get();
var q = createObject('java', 'com.mongodb.BasicDBObject').init(criteria);
search_results = collection.find(q,_keys).limit(limit);
return search_results;
View
25 components/MongoDocument.cfc
@@ -1,4 +1,4 @@
-<cfcomponent implements="IDocument" output="false" hint="Default implementation of IDocument and used by the Mongo class to generate a document.">
+<cfcomponent extends="MongoBase" implements="IDocument" output="false" hint="Default implementation of IDocument and used by the Mongo class to generate a document.">
<cfproperty name="name" default="__DEFAULT_BLANK__" />
@@ -26,16 +26,16 @@
}
variables.mongo.collection(collection_name);
</cfscript>
- <cfreturn this />
+ <cfreturn this />
</cffunction>
-<cffunction name="factory_init" access="package" hint="Constructor. Creates an instance of a MongoDocument using the specified mongo.">
+<cffunction name="factory_init" hint="Constructor. Creates an instance of a MongoDocument using the specified mongo.">
<cfargument name="collection_name" type="string" required="true" hint="The name of the collection to which this document is bound." />
<cfargument name="_mongo" type="any" required="false" default="#variables.mongo#" hint="The instance of the Mongo wrapper to which the document is bound." />
<cfset variables.mongo = _mongo />
<cfset variables.mongo.collection(collection_name) />
- <cfreturn this />
+ <cfreturn this />
</cffunction>
@@ -75,25 +75,26 @@
<cfset var o_id = '' />
<cfset validate() />
<cfset o_id = mongo.put(this.model) />
- <cfset this.model['_id'] = o_id />
+ <cfset this.model['_id'] = o_id.toString() />
<cfreturn o_id />
</cffunction>
<cffunction name="delete" returntype="void" hint="Deletes this Document from the Collection">
- <cfset mongo.delete(this.model) />
+ <cfset mongo.deleteById(this.model['_id']) />
</cffunction>
-<!--- To Do: Update in-place using obj.update(property,value) --->
<cffunction name="update" hint="Performs in-place update of the the value for 'property'. NOT IMPLEMENTED">
- <cfargument name="property" required="false" />
- <cfargument name="value" required="false" />
- <cfset validate() />
- <cfset variables.mongo.update(this.model) />
+ <cfargument name="property">
+ <cfargument name="value">
+ <cfset validate() />
+ <cfthrow type="NotImplementedException" message="To Do.">
</cffunction>
-<cffunction name="validate" hint="Should be called before save() to perform any required validation. NOT IMPLEMENTED" returntype="void"></cffunction>
+<cffunction name="validate" hint="Should be called before save() to perform any required validation. NOT IMPLEMENTED" returntype="void">
+
+</cffunction>
</cfcomponent>
View
10 test/BaseTestCase.cfc
@@ -0,0 +1,10 @@
+<cfcomponent output="false" extends="mxunit.framework.TestCase">
+
+ <cfset dbName = "cfmongodb_tests">
+ <cfset mongo = createObject("component","cfmongodb.Mongo").init()>
+
+ <cffunction name="getCollectionName">
+ <cfreturn lCase(listLast( getMetadata(this).Name ,"."))>
+ </cffunction>
+
+</cfcomponent>
View
38 test/ConfirmSetupTest.cfc
@@ -0,0 +1,38 @@
+<cfcomponent extends="BaseTestCase">
+
+
+
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+ <cfset collectionName = getCollectionName()>
+ <cfset fillBasicCollection()>
+ </cffunction>
+
+ <cffunction name="teardown">
+ <cfset mongo.remove(StructNew(),dbName,collectionName)>
+ </cffunction>
+
+ <cffunction name="fillBasicCollection" output="false" access="package" returntype="any" hint="">
+ <cfset var i = 1>
+ <cfset var tmp = {}>
+ <cfloop from="1" to="10" index="i">
+ <cfset tmp = { number=i, string="this is string #i#", date=now(), boolean=true }>
+ <cfset var result = mongo.update(tmp,dbName,collectionName)>
+ </cfloop>
+ </cffunction>
+
+
+ <cffunction name="when_mongo_is_running_this_should_work" returntype="void" access="public">
+ <cfset debug(getMetadata(mongo.getMongo()))>
+ <!--- guard: ensure that getMongo() returns the real java object --->
+ <cfset assertEquals("com.mongodb.Mongo", getMetadata(mongo.getMongo()).getCanonicalName() )>
+ <cfset var names = mongo.getMongo().getDatabaseNames()>
+ <cfset debug(names)>
+ <cfset assertTrue(arrayLen(names) GT 0)>
+ </cffunction>
+
+ <cffunction name="getMongoDB_returns_valid_mongo_DB_object">
+ <!--- this should not error! --->
+ <cfset var db = mongo.getMongoDB("local")>
+ </cffunction>
+
+</cfcomponent>
View
45 test/MongoBaseTest.cfc
@@ -0,0 +1,45 @@
+<cfcomponent extends="BaseTestCase">
+ <cffunction name="newDBObjectFromStruct_should_return_initialized_DBObject_when_input_is_empty" returntype="void" access="public">
+ <cfset var dbo = mongo.newDBObjectFromStruct({})>
+ <cfset var str = dbo.toString()>
+ <cfset debug(dbo)>
+ <cfset debug(getMetadata(dbo))>
+ <cfset debug(str)>
+ <cfset assertTrue(structIsEmpty(dbo))>
+ <cfset assertEquals("{ }",str)>
+ </cffunction>
+
+ <cffunction name="newDBObjectFromStruct_should_return_populated_DBObject_when_input_struct_has_data" returntype="void" access="public">
+ <cfset var input = {NAME="cfmongodb"}>
+ <cfset var dbo = mongo.newDBObjectFromStruct(input)>
+ <cfset assertTrue(structKeyExists(dbo,"NAME"))>
+ </cffunction>
+
+ <cffunction name="newDBObject_should_return_single_key_Object" output="false" access="public" returntype="any" hint="">
+ <cfset var dbo = mongo.newDBObject("NAME","cfmongodb")>
+ <cfset assertEquals("NAME",structKeyList(dbo))>
+ <cfset assertEquals("cfmongodb",dbo["NAME"],"")>
+ </cffunction>
+
+ <cffunction name="getObjectIDFromID_should_return_java_ObjectID" output="false" access="public" returntype="any" hint="">
+ <cfset var objectID = mongo.getObjectIDFromID("4c0278fefc60eebfd097f017")>
+ <cfset assertEquals("com.mongodb.ObjectID", getMetadata(objectID).getCanonicalName() )>
+ </cffunction>
+
+ <cffunction name="dbObjectToStruct_returns_struct_with_all_nested_data" output="false" access="public" returntype="any" hint="">
+ <cfset var nested = mongo.newDBObject("nested",true)>
+ <cfset var topLevel = mongo.newDBObject("toplevel",nested)>
+ <cfset var struct = mongo.dbObjectToStruct(topLevel)>
+ <cfset debug(struct)>
+ <cfset assertEquals("toplevel",structKeyList(struct))>
+ <cfset assertEquals("nested",structKeyList(struct.toplevel))>
+ </cffunction>
+
+ <cffunction name="newIDCriteriaObject_returns_correctly_populated_DBObject" output="false" access="public" returntype="any" hint="">
+ <cfset var id = "4c0278fefc60eebfd097f017">
+ <cfset var idObject = mongo.newIDCriteriaObject(id)>
+ <cfset assertEquals("_id",structKeyList(idObject))>
+ <cfset assertEquals(id,idObject["_id"])>
+ </cffunction>
+
+</cfcomponent>
View
118 test/MongoDBTest.cfc
@@ -1,63 +1,8 @@
-<cfcomponent output="false" extends="BaseTest">
-<cfscript>
-
-
- function $exploreStringSearchExpression(){
- coll = mongo.getCollection('blog');
-
- key_exp = {TITLE=1,TS=1,AUTHOR=1};
- keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
-
- debug( 'bill' > 'z' );
-
- exp = createObject('java', 'com.mongodb.BasicDBObjectBuilder').start();
- //exp.add( '$ne', javacast('long',1256148920969) ); //bill_792
- exp.add( '$gt', 'bill_792' );
-
- debug( exp.get() );
-
- q = createObject('java', 'com.mongodb.BasicDBObject').init("AUTHOR", exp.get() );
- items = coll.find( q, keys );
- debug(items.count());
- debug(items.toArray().toString());
-
- }
-
-
- function $buildSearchExpressionWithBuilder(){
- coll = mongo.getCollection('blog');
-
- // BasicDBObjectBuilder.start().add( "name" , "eliot" ).add( "number" , 17 ).get()
-
- key_exp = {TITLE=1,TS=1};
- keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
-
- exp = createObject('java', 'com.mongodb.BasicDBObjectBuilder').start();
- exp.add( '$gte', javacast('long',1256148921000 ) );
- //exp.add( '$lte', javacast('long',1256148921000 ) );
-
- debug( exp.get() );
-
- q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", exp.get() );
- items = coll.find( q, keys );
- debug(items.count());
- debug(items.toArray().toString());
-
- }
-
-
- function $findByExpression(){
- coll = mongo.getCollection('blog');
-
- key_exp = {TITLE=1,TS=1};
- keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
+<cfcomponent extends="BaseTestCase">
- exp['$gte']= javacast('long',1256148921000 );
- debug( exp );
- //q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", javacast('long',1256148921000) );
- q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", exp );
- items = coll.find( q, keys );
+ <cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
+<<<<<<< HEAD:test/MongoDBTest.cfc
debug(items.count());
debug(items.toArray().toString());
assert(items.count() > 0);
@@ -96,47 +41,26 @@
</cfscript>
+=======
+>>>>>>> 55e861e72919aa660874119e751de4e0fd3730b3:test/MongoDBTest.cfc
+
+ </cffunction>
+
+ <cffunction name="tearDown" returntype="void" access="public" hint="put things here that you want to run after each test">
-<cffunction name="genBlogData" access="package">
- <cfscript>
- var i = 0;
- var entry = {foo='bar'};
- var start = getTickCount();
- var tags = ['Food','Java','Comics','Games','Python','NoSQL','Ruby','ColdFusion','TDD','JavaScript','JSON','MongoDB'];
- var max = arrayLen(tags);
- var shuffled = createObject('java','java.util.ArrayList').init(tags);
- var r1 = randrange(1,max);
- var r2 = randrange(r1,max);
- var newTags = [];
-
- //Note case sensitivity!!
- mongo.getCollection('blog');
- for(i; i < 1000;i++){
- createObject('java','java.util.Collections').shuffle(tags);
- r1 = randrange(1,max);
- r2 = randrange(r1,max);
- newTags = shuffled.subList(r1,r2);
- entry.title = 'Blog Title No.' & i;
- entry.incr = javacast('int',i);
- entry.author = 'bill_' & i;
- entry.tags = newTags;
- entry.ts = javacast('long',getTickCount());
- entry.body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu justo lectus. Morbi aliquet consectetur consequat. Mauris mauris nulla, condimentum in aliquet nec, suscipit in lacus. Donec vel ante ut metus imperdiet interdum. Curabitur non sapien at felis egestas bibendum in eu urna. In rutrum ligula erat. Integer tristique viverra consequat. Curabitur tristique velit vel nunc aliquet congue eleifend lacus cursus. Aenean a lorem a arcu tincidunt tempus. Nulla faucibus diam in sem consequat tincidunt. Aenean quis nunc vitae leo luctus porta. Etiam justo enim, imperdiet vel commodo sed, placerat nec dolor. Nunc placerat sapien id ligula varius eget tempus est eleifend.
+ </cffunction>
-Vivamus ipsum justo, interdum ut blandit feugiat, tempus id erat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla dignissim eros quis velit vestibulum ullamcorper. Donec mattis venenatis augue sed semper. Donec egestas dapibus mauris cursus elementum. Phasellus egestas porta quam vitae sodales. Vestibulum ut tortor vitae enim mollis placerat. Sed tortor orci, venenatis sit amet auctor in, condimentum vitae enim. In vel nulla velit. Proin ultrices vehicula nibh a interdum. Integer rhoncus luctus est sit amet placerat. In commodo, mauris id consectetur pulvinar, massa nibh condimentum nunc, non fermentum lacus turpis vitae nisl. Curabitur at dui eu leo laoreet luctus in eu diam. Aliquam ante velit, venenatis sit amet sollicitudin non, adipiscing in orci. Curabitur tristique bibendum volutpat. Donec blandit tempor vestibulum. Sed lorem justo, fringilla vel hendrerit sit amet, pellentesque lobortis turpis. Integer sed turpis quis dolor suscipit mollis in a nibh. Aenean blandit condimentum erat, eget consequat erat cursus eu. Vestibulum in massa tortor.
+ <cffunction name="db_returns_cfmongodb_db">
+ <cfset var db = mongo.db(dbName)>
+ <cfset debug(db)>
+ <cfset assertIsExactTypeOf(db,"cfmongodb.components.Database")>
+ </cffunction>
-In adipiscing, purus in ultrices euismod, tortor mauris congue felis, vel tincidunt leo sapien sit amet urna. Etiam id augue enim, non facilisis lectus. Vestibulum tincidunt nulla ut tortor faucibus a luctus elit pellentesque. Donec ornare lacus quis lorem vulputate tristique. Nulla facilisi. Donec pretium, risus sit amet volutpat tempor, mi tellus molestie dui, sit amet volutpat nibh enim at orci. Aliquam metus urna, posuere ac pulvinar a, consequat in erat. Fusce sed tortor mi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum tempus placerat luctus. Nam convallis, justo et accumsan porta, quam felis semper lorem, in tristique leo dui et turpis. In hendrerit lacinia tellus condimentum ullamcorper. Suspendisse neque massa, convallis eu accumsan et, fringilla in ante. Integer in urna at tellus ultricies semper in at justo. Phasellus ac neque in magna pharetra aliquet. Integer vehicula pharetra magna a blandit. Vestibulum in aliquet mauris. Fusce molestie libero sed nunc accumsan lacinia. Morbi posuere auctor vehicula. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+ <cffunction name="collection_returns_cfmongodb_collection" output="false" access="public" returntype="any" hint="">
+ <cfset var coll = mongo.collection(dbName,basicCollectionName)>
+ <!---<cfset debug(coll)>--->
+ <cfset assertIsExactTypeOf(coll,"cfmongodb.components.Collection")>
+ </cffunction>
-In eget dui eu justo ullamcorper cursus. Duis convallis nisi tincidunt neque semper a suscipit magna sagittis. Vivamus sodales augue a odio congue ac iaculis erat accumsan. Morbi at neque non ipsum eleifend varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean fermentum velit in nisi porta eu aliquet diam dictum. Curabitur eleifend ornare nisi, ac commodo urna aliquam a. In at eros enim, et porta augue. Morbi at convallis ligula. Sed odio elit, ultricies vel porta id, dictum id nunc. Nulla massa metus, rhoncus quis consectetur ac, pellentesque at dolor. Vestibulum elementum, metus vitae porttitor pulvinar, neque est interdum nulla, ut placerat enim nunc eu purus. In ac risus et ligula dignissim condimentum. Sed quis elit mauris, mollis bibendum odio. Nullam diam mi, semper eu malesuada in, mattis in lacus. Mauris varius, neque vitae vestibulum hendrerit, nisl risus porta metus, vel dignissim tortor arcu eu erat.
-Aenean sapien mi, gravida cursus varius a, faucibus non elit. Etiam bibendum mollis orci id dignissim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In nisi enim, vestibulum eu sollicitudin vitae, ultricies vitae tortor. Aliquam sed turpis quis enim lobortis suscipit nec et nisi. Pellentesque a nisi erat. Mauris congue ultricies libero, nec tempus ipsum ullamcorper quis. Integer varius magna a lectus fringilla et ultrices augue molestie. Quisque eget interdum est. Nunc cursus pellentesque risus, tempus hendrerit mauris imperdiet ut. Maecenas a orci in nulla varius lacinia sit amet quis urna. Pellentesque lacinia consequat mollis. Vestibulum vel odio lectus, luctus viverra dui. Sed sed arcu velit, at pharetra ligula. Praesent convallis commodo mi ut laoreet. ';
- //dump(entry);
- mongo.put(entry);
- }
- debug(getTickCount()-start);
-
- </cfscript>
-</cffunction>
-<!---
- --->
-</cfcomponent>
+</cfcomponent>
View
8 test/MongoTest.cfc
@@ -0,0 +1,8 @@
+<cfcomponent extends="BaseTestCase">
+
+ <cffunction name="init_should_return_mongodb_object" returntype="void">
+ <cfset var mongo = createObject("cfmongodb.Mongo").init()>
+ <cfset assertIsExactTypeOf(mongo,"cfmongodb.components.MongoDB")>
+ </cffunction>
+
+</cfcomponent>
View
0  test/BaseTest.cfc → test/orig/BaseTest.cfc
File renamed without changes
View
12 test/CollectionEachIteratorTest.cfc → test/orig/CollectionEachIteratorTest.cfc
@@ -1,5 +1,5 @@
<cfcomponent extends="BaseTest">
-<!---
+<!---
In a single file, implement multiple models
--->
<cfscript>
@@ -7,18 +7,18 @@
config = {
server_name = 'localhost',
server_port = 27017,
- db_name = 'dev_db',
- collection_name = 'test'
+ db_name = 'default_db',
+ collection_name = 'test'
};
-
+
function testEachIterator(){
mongo = createObject('component','cfmongodb.components.MongoDB');
mongo.getDb('goodcoders');
doc = mongo.new_doc('person');
doc.set('name','bill');
doc.save();
-
-
+
+
}
</cfscript>
View
0  test/DatabaseTest.cfc → test/orig/DatabaseTest.cfc
File renamed without changes
View
0  test/DocumentFactoryModelTest.cfc → test/orig/DocumentFactoryModelTest.cfc
File renamed without changes
View
0  test/DocumentTest.cfc → test/orig/DocumentTest.cfc
File renamed without changes
View
0  test/ExpressionBuilderTest.cfc → test/orig/ExpressionBuilderTest.cfc
File renamed without changes
View
0  test/InheritedDocumentTest.cfc → test/orig/InheritedDocumentTest.cfc
File renamed without changes
View
0  test/IntrospectionTest.cfc → test/orig/IntrospectionTest.cfc
File renamed without changes
View
0  test/ModelTest.cfc → test/orig/ModelTest.cfc
File renamed without changes
View
150 test/orig/MongoDBTest.cfc
@@ -0,0 +1,150 @@
+<cfcomponent output="false" extends="BaseTest">
+<cfscript>
+
+
+ function $exploreStringSearchExpression(){
+ coll = mongo.getCollection('blog');
+
+ key_exp = {TITLE=1,TS=1,AUTHOR=1};
+ keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
+
+ debug( 'bill' > 'z' );
+
+ exp = createObject('java', 'com.mongodb.BasicDBObjectBuilder').start();
+ //exp.add( '$ne', javacast('long',1256148920969) ); //bill_792
+ exp.add( '$gt', 'bill_792' );
+
+ debug( exp.get() );
+
+ q = createObject('java', 'com.mongodb.BasicDBObject').init("AUTHOR", exp.get() );
+ items = coll.find( q, keys );
+ debug(items.count());
+ debug(items.toArray().toString());
+
+ }
+
+
+ function $buildSearchExpressionWithBuilder(){
+ coll = mongo.getCollection('blog');
+
+ // BasicDBObjectBuilder.start().add( "name" , "eliot" ).add( "number" , 17 ).get()
+
+ key_exp = {TITLE=1,TS=1};
+ keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
+
+ exp = createObject('java', 'com.mongodb.BasicDBObjectBuilder').start();
+ exp.add( '$gte', javacast('long',1256148921000 ) );
+ //exp.add( '$lte', javacast('long',1256148921000 ) );
+
+ debug( exp.get() );
+
+ q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", exp.get() );
+ items = coll.find( q, keys );
+ debug(items.count());
+ debug(items.toArray().toString());
+
+ }
+
+
+ function $findByExpression(){
+ coll = mongo.getCollection('blog');
+
+ key_exp = {TITLE=1,TS=1};
+ keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
+
+ exp['$gte']= javacast('long',1256148921000 );
+ debug( exp );
+ //q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", javacast('long',1256148921000) );
+ q = createObject('java', 'com.mongodb.BasicDBObject').init("TS", exp );
+ items = coll.find( q, keys );
+
+ debug(items.count());
+ debug(items.toArray().toString());
+ assert(items.count() > 0);
+
+ }
+
+
+ function $findByRegEx(){
+ coll = mongo.getCollection('blog');
+ debug(coll.getName());
+ p = createObject('java', 'java.util.regex.Pattern').compile('bill_6[0-2].*');
+ exp = { AUTHOR=p };
+ key_exp = {AUTHOR=1,TITLE=1,TS=1};
+ keys = createObject('java', 'com.mongodb.BasicDBObject').init(key_exp);
+ q = createObject('java', 'com.mongodb.BasicDBObject').init(exp);
+ items = coll.find( q, keys );
+ debug(items.count());
+ debug(items.toArray().toString());
+
+ }
+
+
+ function genDataTest(){
+ // uncomment next line to generate data :
+ // genBlogData() ;
+ }
+
+
+ function setUp(){
+ //mongo = createObject('component','cfmongodb.MongoDB');
+ }
+
+ function tearDown(){
+
+ }
+
+
+</cfscript>
+
+<cffunction name="genBlogData" access="package">
+ <cfscript>
+ var i = 0;
+ var entry = {foo='bar'};
+ var start = getTickCount();
+ var tags = ['Food','Java','Comics','Games','Python','NoSQL','Ruby','ColdFusion','TDD','JavaScript','JSON','MongoDB'];
+ var max = arrayLen(tags);
+ var shuffled = createObject('java','java.util.ArrayList').init(tags);
+ var r1 = randrange(1,max);
+ var r2 = randrange(r1,max);
+ var newTags = [];
+
+ var config = {
+ server_name = 'localhost',
+ server_port = 27017,
+ db_name = 'default_db',
+ collection_name = 'blog'
+ };
+ mongo.init(config);
+
+ //Note case sensitivity!!
+ mongo.getCollection('blog');
+ for(i; i < 1000;i++){
+ createObject('java','java.util.Collections').shuffle(tags);
+ r1 = randrange(1,max);
+ r2 = randrange(r1,max);
+ newTags = shuffled.subList(r1,r2);
+ entry.title = 'Blog Title No.' & i;
+ entry.incr = javacast('int',i);
+ entry.author = 'bill_' & i;
+ entry.tags = newTags;
+ entry.ts = javacast('long',getTickCount());
+ entry.body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eu justo lectus. Morbi aliquet consectetur consequat. Mauris mauris nulla, condimentum in aliquet nec, suscipit in lacus. Donec vel ante ut metus imperdiet interdum. Curabitur non sapien at felis egestas bibendum in eu urna. In rutrum ligula erat. Integer tristique viverra consequat. Curabitur tristique velit vel nunc aliquet congue eleifend lacus cursus. Aenean a lorem a arcu tincidunt tempus. Nulla faucibus diam in sem consequat tincidunt. Aenean quis nunc vitae leo luctus porta. Etiam justo enim, imperdiet vel commodo sed, placerat nec dolor. Nunc placerat sapien id ligula varius eget tempus est eleifend.
+
+Vivamus ipsum justo, interdum ut blandit feugiat, tempus id erat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla dignissim eros quis velit vestibulum ullamcorper. Donec mattis venenatis augue sed semper. Donec egestas dapibus mauris cursus elementum. Phasellus egestas porta quam vitae sodales. Vestibulum ut tortor vitae enim mollis placerat. Sed tortor orci, venenatis sit amet auctor in, condimentum vitae enim. In vel nulla velit. Proin ultrices vehicula nibh a interdum. Integer rhoncus luctus est sit amet placerat. In commodo, mauris id consectetur pulvinar, massa nibh condimentum nunc, non fermentum lacus turpis vitae nisl. Curabitur at dui eu leo laoreet luctus in eu diam. Aliquam ante velit, venenatis sit amet sollicitudin non, adipiscing in orci. Curabitur tristique bibendum volutpat. Donec blandit tempor vestibulum. Sed lorem justo, fringilla vel hendrerit sit amet, pellentesque lobortis turpis. Integer sed turpis quis dolor suscipit mollis in a nibh. Aenean blandit condimentum erat, eget consequat erat cursus eu. Vestibulum in massa tortor.
+
+In adipiscing, purus in ultrices euismod, tortor mauris congue felis, vel tincidunt leo sapien sit amet urna. Etiam id augue enim, non facilisis lectus. Vestibulum tincidunt nulla ut tortor faucibus a luctus elit pellentesque. Donec ornare lacus quis lorem vulputate tristique. Nulla facilisi. Donec pretium, risus sit amet volutpat tempor, mi tellus molestie dui, sit amet volutpat nibh enim at orci. Aliquam metus urna, posuere ac pulvinar a, consequat in erat. Fusce sed tortor mi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Vestibulum tempus placerat luctus. Nam convallis, justo et accumsan porta, quam felis semper lorem, in tristique leo dui et turpis. In hendrerit lacinia tellus condimentum ullamcorper. Suspendisse neque massa, convallis eu accumsan et, fringilla in ante. Integer in urna at tellus ultricies semper in at justo. Phasellus ac neque in magna pharetra aliquet. Integer vehicula pharetra magna a blandit. Vestibulum in aliquet mauris. Fusce molestie libero sed nunc accumsan lacinia. Morbi posuere auctor vehicula. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+
+In eget dui eu justo ullamcorper cursus. Duis convallis nisi tincidunt neque semper a suscipit magna sagittis. Vivamus sodales augue a odio congue ac iaculis erat accumsan. Morbi at neque non ipsum eleifend varius. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean fermentum velit in nisi porta eu aliquet diam dictum. Curabitur eleifend ornare nisi, ac commodo urna aliquam a. In at eros enim, et porta augue. Morbi at convallis ligula. Sed odio elit, ultricies vel porta id, dictum id nunc. Nulla massa metus, rhoncus quis consectetur ac, pellentesque at dolor. Vestibulum elementum, metus vitae porttitor pulvinar, neque est interdum nulla, ut placerat enim nunc eu purus. In ac risus et ligula dignissim condimentum. Sed quis elit mauris, mollis bibendum odio. Nullam diam mi, semper eu malesuada in, mattis in lacus. Mauris varius, neque vitae vestibulum hendrerit, nisl risus porta metus, vel dignissim tortor arcu eu erat.
+
+Aenean sapien mi, gravida cursus varius a, faucibus non elit. Etiam bibendum mollis orci id dignissim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In nisi enim, vestibulum eu sollicitudin vitae, ultricies vitae tortor. Aliquam sed turpis quis enim lobortis suscipit nec et nisi. Pellentesque a nisi erat. Mauris congue ultricies libero, nec tempus ipsum ullamcorper quis. Integer varius magna a lectus fringilla et ultrices augue molestie. Quisque eget interdum est. Nunc cursus pellentesque risus, tempus hendrerit mauris imperdiet ut. Maecenas a orci in nulla varius lacinia sit amet quis urna. Pellentesque lacinia consequat mollis. Vestibulum vel odio lectus, luctus viverra dui. Sed sed arcu velit, at pharetra ligula. Praesent convallis commodo mi ut laoreet. ';
+ //dump(entry);
+ mongo.put(entry);
+ }
+ debug(getTickCount()-start);
+
+ </cfscript>
+</cffunction>
+<!---
+ --->
+</cfcomponent>
View
0  test/MongoSmokeTest.cfc → test/orig/MongoSmokeTest.cfc
File renamed without changes
View
0  test/NewDocumentTest.cfc → test/orig/NewDocumentTest.cfc
File renamed without changes
View
0  test/SearchMongoTest.cfc → test/orig/SearchMongoTest.cfc
File renamed without changes
View
0  test/SomeDoc.cfc → test/orig/SomeDoc.cfc
File renamed without changes
View
0  test/TestSuiteTest.cfc → test/orig/TestSuiteTest.cfc
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.