Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (29 sloc) 0.735 kB
<cfscript>
mongo = application.mongo;
collection = application.collection;
dbCol = mongo.getDBCollection( collection );
counters = dbCol.distinct( "COUNTER" );
arraySort( counters, "numeric", "desc" );
if( NOT arrayIsEmpty(counters) ){
nextNum = counters[1] + 1;
} else {
nextNum = 1;
}
coolPeople = [];
for( i = nextNum; i LTE nextNum + 50; i++ ){
DOC =
{
NAME = "Cool Person #i#",
SPOUSE = "Cool Spouse #i#",
KIDS = [
{NAME="kid #i#", age=randRange(1,80), HAIR="strawberry", DESCRIPTION="fun" },
{NAME="kid #i+1#", age=randRange(1,80), HAIR="raven", DESCRIPTION="joyful" }
],
BIKE = "Specialized",
TS = now(),
COUNTER = i
};
arrayAppend( coolPeople, doc );
}
dbCol.saveAll( coolPeople );
</cfscript>
Jump to Line
Something went wrong with that request. Please try again.