lucee.Componentcbmongodb.Mongo.Collection
Mongo Collection The collection interface used for client operations by CBMongodb. Handles the translation of CFML objects for the DBCollection instance.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
collectionName
The name of our collection.
|
true
|
false
|
|
any
|
dbCollection
The native java Collection Object.
|
true
|
false
|
|
any
|
jLoader
CBJavaloader.
|
true
|
false
|
|
any
|
MongoUtil
Mongo Utils.
|
true
|
false
|
Constructor Summary | |
---|---|
init([any dbCollectionInstance])
Constructor - Must be manually instantiated with the Mongo Collection Object. |
Method Summary | |
---|---|
any
|
aggregate([struct criteria], struct group, [struct projection], [any sort], [any groupMatch])
Performs an aggregation operation on the collection using match or projection. |
any
|
aggregation(array command)
|
any
|
bulkWrite()
Facade for the driver's bulkWrite() method. |
any
|
count([any criteria='[runtime expression]'])
Counts the number of records, by restriction or in total. |
any
|
createGeoIndex(string field, any options='[runtime expression]', string geoType='2dsphere')
Creates a geospatial index. |
any
|
createIndex(any operation, any options='[runtime expression]')
Creates a standard index. |
any
|
createIndexes(array indexes)
Creates multiple indexes. |
any
|
deleteMany(any criteria='[runtime expression]')
Deletes many documents by criteria. |
any
|
deleteOne(any criteria)
Deletes a single document by criteria. |
any
|
distinct(string fieldName, [struct criteria='[runtime expression]'])
Returns the list of distinct values for a specified field name. |
any
|
drop()
Drops the collection. |
any
|
dropIndex([string indexName], [any criteria])
Drops an index Either a name or a criteria to search the existing indexes may be specified. |
any
|
dropIndexes()
Drops all indexes in a collection. |
any
|
find(any criteria='[runtime expression]', struct options='[runtime expression]')
Facade for the drivers find method. |
any
|
findById(any id)
Finds a single document by its _id. |
any
|
findOneAndDelete(struct criteria, [any options])
Finds one document and deletes it. |
any
|
findOneAndReplace(any criteria, any document)
Finds a single document and replaces it. |
any
|
findOneAndUpdate(any criteria, any operation)
Updates a single document found by a designated criteria. |
string
|
getCollectionName()
|
string
|
getDbCollection()
|
any
|
getIndexInfo()
Returns an array of object maps for all of the indexes in the collection. |
string
|
getJLoader()
|
string
|
getMongoUtil()
|
any
|
insertMany(array docs)
Inserts an array of document. |
any
|
insertOne(any document)
Inserts a single document. |
any
|
mapReduce(string map, string reduce)
Performs a Map-Reduce operation on the collection. |
any
|
onDIComplete()
|
any
|
remove(any criteria, [any multiple='true'])
Utility method which emulates the remove() method available in the v2 Mongo java drivers. |
any
|
replaceOne(any criteria, any document)
Replaces one document found by a designated criteria . |
any
|
save(any document, any upsert='false')
Generic Save Function - Uses findOneAndReplace(). |
any
|
setCollectionName(any collectionName)
|
any
|
setDbCollection(any dbCollection)
|
any
|
setJLoader(any jLoader)
|
any
|
setMongoUtil(any MongoUtil)
|
private any
|
toMongo(any obj)
Utility facade for Mongo. |
private any
|
toMongoDocument(any doc)
Utility facade for Mongo. |
any
|
updateMany(any criteria, any operation)
Updates multiple documents found by a designated criteria . |
any
|
updateOne(any criteria, any operation)
Updates one document found by a designated criteria . |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor - Must be manually instantiated with the Mongo Collection Object
dbCollectionInstance
Property Detail |
---|
The name of our collection
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe native java Collection Object
access
- publicrequired
- falsereturntype
- anyserializable
- trueCBJavaloader
access
- publicrequired
- falsereturntype
- anyinject
- id:loader@cbjavaloaderserializable
- trueMongo Utils
access
- publicrequired
- falsereturntype
- anyinject
- id:MongoUtil@cbmongodbserializable
- trueMethod Detail |
---|
Performs an aggregation operation on the collection using match or projection
See https://docs.mongodb.org/manual/aggregation/ for more information and commands
criteria
group
projection
sort
groupMatch
command
Facade for the driver's bulkWrite() method
NOTE: Not implemented as CF native at the present time. Operations will need to be performed using the java arguments: http://api.mongodb.org/java/current/com/mongodb/DBCollection.html
Counts the number of records, by restriction or in total
criteria
Creates a geospatial index
field
options
geoType
Creates a standard index
operation
options
Creates multiple indexes
indexes
Deletes many documents by criteria
criteria
Deletes a single document by criteria
criteria
Returns the list of distinct values for a specified field name
fieldName
criteria
Drops the collection
Drops an index Either a name or a criteria to search the existing indexes may be specified
indexName
criteria
Drops all indexes in a collection
Facade for the drivers find method. Encapuslates the result with a number of utility methods
criteria
options
Finds a single document by its _id
id
Finds one document and deletes it
criteria
options
Finds a single document and replaces it
criteria
document
Updates a single document found by a designated criteria
criteria
operation
Returns an array of object maps for all of the indexes in the collection
Inserts an array of document
docs
Inserts a single document
document
Performs a Map-Reduce operation on the collection
See Mongo Documentation for more information on Map-Reduce functionality
map
reduce
Utility method which emulates the remove() method available in the v2 Mongo java drivers
criteria
multiple
Replaces one document found by a designated criteria
NOTE: facade for findOneAndReplace()
criteria
document
Generic Save Function - Uses findOneAndReplace()
document
upsert
collectionName
dbCollection
jLoader
MongoUtil
Utility facade for Mongo.Util.toMongo
obj
Utility facade for Mongo.Util.toMongoDocument
doc
Updates multiple documents found by a designated criteria
NOTE: facade for findOneAndUpdate()
criteria
operation
Updates one document found by a designated criteria
NOTE: facade for findOneAndUpdate()
criteria
operation