Skip to content

Commit

Permalink
udpated function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcesher committed Dec 12, 2010
1 parent db07a32 commit aa0d833
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/Mongo.cfc
Expand Up @@ -87,7 +87,7 @@
/**
* Runs mongodb's distinct() command. Returns an array of distinct values
*
distinctAges = mongo.distinct( "KIDS.AGE" );
distinctAges = mongo.distinct( "KIDS.AGE", "people" );
*/
function distinct(string key, string collectionName, mongoConfig=""){
return getMongoDBCollection(collectionName, mongoConfig).distinct( key );
Expand Down Expand Up @@ -140,10 +140,10 @@
The "doc" argument will either be an existing Mongo document to be updated based on its _id, or it will be a document that will be "applied" to any documents that match the "query" argument
To update a single existing document, keep query as an empty struct and update will update the document by its _id:
To update a single existing document, simply pass that document and update() will update the document by its _id:
person = person.findById(url.id);
person.something = "something else";
mongo.update( person, people );
mongo.update( person, "people" );
To update a document by a criteria query and have the "doc" argument applied to a single found instance:
update = {STATUS = "running"};
Expand Down

0 comments on commit aa0d833

Please sign in to comment.