CFML Functions

mongo Category functions

Function Name Description
MongoCollectionaggregate Performs an aggregated function against the given collection
MongoCollectioncount Counts the number of documents in a collection, filtering with the optional query
MongoCollectiondistinct Finds all the distinct values for the key for the collection against the optional query
MongoCollectiondrop Drops the given collection if it exists. Returns true
MongoCollectionfind Performs a query against Mongo returning back an array of structures of the documents matching the query
MongoCollectionfindandmodify Finds the first document in the query and updates it
MongoCollectionfindone Performs a query against Mongo returning the first document
MongoCollectiongroup no longer supported, use MongoCollectionAggregator()
MongoCollectionindexdrop Drops the given index from the collection
MongoCollectionindexensure Ensures the given index for the collection exists, or creates it if not
MongoCollectioninsert Inserts the elements into a collection to Mongo, returning the _id's of elements that were inserted. If each structure does not have a _id then one will be automatically assigned and returned
MongoCollectionlist Lists all the available collections
MongoCollectionmapreduce Runs a Map Reduce command
MongoCollectionremove Removes the objects that this query will find
MongoCollectionrename Counts the number of documents in a collection, filtering with the optional query
MongoCollectionsave Saves the object into mongo, doing an INSERT or an UPDATE depending on the existence of _id
MongoCollectionstats Returns the statistics for this given collection; like running db.colStats()
MongoCollectionupdate Updates the data in mongo
MongoDatabasedrop Drops the database referenced by this datasource
MongoDatabaselist Lists all the available databases
MongoDatabaseruncmd Runs the given command against the database referenced by this datasource
MongoDatabasestats Returns the server statistics, a wrapper to the command: db.dbStats()
MongoDeregister Remove the Mongo datasource
MongoGridfsfind Finds a given file(s) from the Mongo GridFS bucket. You can get the file specifying either file name, _id or a query. You can download the actual file using MongoGridFSGet()
MongoGridfsfindone Finds a given file from the Mongo GridFS bucket. You can get the file specifying either file name, _id or a query. It multiple match, it will return the first one. You can download the actual file using MongoGridFSGet()
MongoGridfsget Downloads the given file from the Mongo GridFS bucket. If successful and 'filepath' will return TRUE, otherwise FALSE if the file was not found. If not using 'filepath', then the function will return the object. You can get the file specifying either file name, _id or a query. It multiple match, it will return the first one.
MongoGridfsremove Deletes a file(s) from the Mongo GridFS bucket. You can delete specifying either file, _id or a query.
MongoGridfssave Saves a file into a Mongo GridFS bucket returning back the _id of the resulting object
MongoIsvalid Determines if the Mongo datasource has been already been registered
MongoObjectid Creates a ObjectID function for use with Mongo generated ID's
MongoRegister Creates a new datasource for Mongo, to be referenced using the 'name' by the other Mongo functions. If already exists an exception will be thrown. If the connection has not been used within 5minutes it will be automatically closed and reopened on the next time it is called upon