lucee.Componentcbmongodb.Mongo.Client
Mongo Client Maintains the Database Connection via the Native Driver
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
collections
|
true
|
false
|
|
any
|
databases
|
true
|
false
|
|
any
|
jLoader
CBJavaloader.
|
true
|
false
|
|
any
|
Mongo
Properties created on init().
|
true
|
false
|
|
any
|
MongoAsync
|
true
|
false
|
|
any
|
MongoConfig
|
true
|
false
|
|
any
|
MongoUtil
Utility Class.
|
true
|
false
|
|
any
|
ReadPreference
|
true
|
false
|
|
any
|
wirebox
Wirebox.
|
true
|
false
|
|
any
|
WriteConcern
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
any
|
addUser([string username], [string password])
Adds a user to the database. |
any
|
close()
Closes the underlying mongodb object. |
any
|
connect(any dbName='[runtime expression]')
Our connection to the Mongo Server. |
private any
|
createCredential(string username, string password, any authDB='admin')
|
any
|
dropDatabase()
Drops the database currently specified in MongoConfig. |
string
|
getCollections()
|
string
|
getDatabases()
|
any
|
getDBCollection([any collectionName], [any dbName='[runtime expression]'])
Gets a CBMongoDB DBCollection object, which wraps the java DBCollection. |
string
|
getJLoader()
|
any
|
getLastError()
Returns the last error for the current connection. |
any
|
getMongo()
Get the underlying Java driver's Mongo object. |
string
|
getMongoAsync()
|
any
|
getMongoConfig([any mongoConfig=''])
Decide whether to use the MongoConfig in the variables scope, the one being passed around as arguments, or create a new one. |
any
|
getMongoDB([any mongoConfig=''])
Get the underlying Java driver's DB object. |
string
|
getMongoUtil()
|
string
|
getReadPreference()
|
string
|
getWirebox()
|
string
|
getWriteConcern()
|
private any
|
initCollections()
|
private any
|
initDatabases()
|
any
|
onDIComplete()
After init the autowire properties. |
any
|
setCollections(any collections)
|
any
|
setDatabases(any databases)
|
any
|
setJLoader(any jLoader)
|
any
|
setMongo(any Mongo)
|
any
|
setMongoAsync(any MongoAsync)
|
any
|
setMongoConfig(any MongoConfig)
|
any
|
setMongoUtil(any MongoUtil)
|
any
|
setReadPreference(any ReadPreference)
|
any
|
setWirebox(any wirebox)
|
any
|
setWriteConcern(any WriteConcern)
|
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueCBJavaloader
access
- publicrequired
- falsereturntype
- anyinject
- id:loader@cbjavaloaderserializable
- trueProperties created on init()
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- id:MongoConfig@cbmongodbserializable
- trueUtility Class
access
- publicrequired
- falsereturntype
- anyinject
- id:MongoUtil@cbmongodbserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueWirebox
access
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Adds a user to the database
username
password
Closes the underlying mongodb object. Once closed, you cannot perform additional mongo operations and you'll need to init a new mongo. Best practice is to close mongo in your Application.cfc's onApplicationStop() method. Something like: getBeanFactory().getBean("mongo").close(); or application.mongo.close() depending on how you're initializing and making mongo available to your app NOTE: If you do not close your mongo object, you WILL leak connections!
Our connection to the Mongo Server
dbName
username
password
authDB
Drops the database currently specified in MongoConfig
Gets a CBMongoDB DBCollection object, which wraps the java DBCollection
collectionName
dbName
Returns the last error for the current connection.
Get the underlying Java driver's Mongo object
Decide whether to use the MongoConfig in the variables scope, the one being passed around as arguments, or create a new one
mongoConfig
Get the underlying Java driver's DB object
mongoConfig
After init the autowire properties
collections
databases
jLoader
Mongo
MongoAsync
MongoConfig
MongoUtil
ReadPreference
wirebox
WriteConcern