lucee.Componentcbmongodb.BaseDocumentService
Core MongoDB Document Service
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
_default_document
The container for the default document.
|
true
|
false
|
|
any
|
_document
package container for the active document entity.
|
true
|
false
|
|
any
|
_existing
package container for the loaded document before modifications.
|
true
|
false
|
|
any
|
_id
The id of the loaded document.
|
true
|
false
|
|
any
|
_map
The schema map which will be persisted for validation and typing.
|
true
|
false
|
|
any
|
_validation
Validation structure.
|
true
|
false
|
|
any
|
appSettings
The Coldbox Application Setttings Structure.
|
true
|
false
|
|
any
|
collection
This key is maintained for backward compatibility but is marked as deprecated.
|
default
|
true
|
false
|
any
|
db
The database client w/o a specified collection.
|
true
|
false
|
|
any
|
dbInstance
The instatiated database collection to perform operations on.
|
true
|
false
|
|
any
|
logbox
The LogBox Logger for this Entity.
|
true
|
false
|
|
any
|
MongoClient
The MongoDB Client.
|
true
|
false
|
|
any
|
MongoIndexer
The Mongo Indexer Object.
|
true
|
false
|
|
any
|
MongoUtil
The Mongo Utilities Library.
|
true
|
false
|
|
any
|
wirebox
The Application Wirebox IOC Instance.
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
any
|
append(string key, any value)
Appends to an existing array schema property. |
any
|
applyIndex(any prop, [any properties='[runtime expression]'])
Create and apply our indexes. |
struct
|
asStruct()
Utility facade for getDocument(). |
void
|
criteria([struct criteria])
Document Object Location, Searching and Query Utils ***************************************. |
any
|
delete(any _id)
Deletes a document by ID. |
any
|
detect()
Evaluate our properties for the default document. |
any
|
evict()
Evicts the document entity and clears the query arguments. |
void
|
generateSchemaAccessors(struct prop)
SETTERS **********************************. |
any
|
get(any _id, [any returnInstance='true'])
Load a record by _id. |
string
|
get_default_document()
|
string
|
get_document()
|
string
|
get_existing()
|
string
|
get_id()
|
string
|
get_map()
|
string
|
get_validation()
|
string
|
getAppSettings()
|
string
|
getCollection()
|
any
|
getCollectionObject()
Returns the Mongo. |
string
|
getDb()
|
string
|
getDbInstance()
|
struct
|
getDocument()
Returns a CFML copy of the loaded document. |
string
|
getDocumentPath(string key)
Returns the document path for a given property name or key. |
string
|
getLogbox()
|
string
|
getMongoClient()
|
string
|
getMongoIndexer()
|
string
|
getMongoUtil()
|
any
|
getNormalizedData(string key)
Returns the normalized data for a normalization key. |
any
|
getPropertyDefault([any prop])
Returns the default property value. |
string
|
getWirebox()
|
boolean
|
hasExistingAccessor(string suffix)
|
boolean
|
isNormalizationKey(string key)
Determines whether a property is a normalization key for another property. |
any
|
load(any _id, [any returnInstance='true'])
Alias for get(). |
any
|
locate([string key])
Helper function to locate deeply nested document items. |
numeric
|
mapOrder(any order)
SQL to Mongo ordering translations. |
any
|
normalizeOn(string key)
Processes auto-normalization of a field. |
any
|
populate(struct document)
Populate the document object with a structure. |
any
|
prepend(string key, any value)
Prepends to an existing array property. |
any
|
reset()
reset the document state. |
any
|
set(any key, any value)
Sets a document property. |
any
|
set_default_document(any _default_document)
|
any
|
set_document(any _document)
|
any
|
set_existing(any _existing)
|
any
|
set_id(any _id)
|
any
|
set_map(any _map)
|
any
|
set_validation(any _validation)
|
any
|
setAppSettings(any appSettings)
|
any
|
setCollection(any collection)
|
any
|
setDb(any db)
|
any
|
setDbInstance(any dbInstance)
|
any
|
setLogbox(any logbox)
|
any
|
setMongoClient(any MongoClient)
|
any
|
setMongoIndexer(any MongoIndexer)
|
any
|
setMongoUtil(any MongoUtil)
|
any
|
setWirebox(any wirebox)
|
any
|
toGeoJSON([array coordinates], [string type='Point'])
Handles correct formatting of geoJSON objects. |
any
|
toMongo(any arg)
facade for Mongo. |
any
|
toMongoDocument(struct arg)
facade for Mongo. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
The container for the default document
access
- publicrequired
- falsereturntype
- anyserializable
- truepackage container for the active document entity
access
- publicrequired
- falsereturntype
- anyserializable
- truepackage container for the loaded document before modifications
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe id of the loaded document
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe schema map which will be persisted for validation and typing
access
- publicrequired
- falsereturntype
- anyserializable
- trueValidation structure
access
- publicrequired
- falsereturntype
- anyexample
- property name="myfield" schema=true validate="string";serializable
- trueThe Coldbox Application Setttings Structure
access
- publicrequired
- falsereturntype
- anyserializable
- trueThis key is maintained for backward compatibility but is marked as deprecated. You should use the component attribute method to declare your collection name.
access
- publicrequired
- falsereturntype
- anydeprecated
- trueserializable
- trueThe database client w/o a specified collection
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe instatiated database collection to perform operations on
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe LogBox Logger for this Entity
access
- publicrequired
- falsereturntype
- anyinject
- logbox:logger:{this}serializable
- trueThe MongoDB Client
access
- publicrequired
- falsereturntype
- anyinject
- id:MongoClient@cbmongodbserializable
- trueThe Mongo Indexer Object
access
- publicrequired
- falsereturntype
- anyinject
- id:MongoIndexer@cbmongodbserializable
- trueThe Mongo Utilities Library
access
- publicrequired
- falsereturntype
- anyinject
- id:MongoUtil@cbmongodbserializable
- trueThe Application Wirebox IOC Instance
access
- publicrequired
- falsereturntype
- anyinject
- wireboxserializable
- trueMethod Detail |
---|
Appends to an existing array schema property
key
value
Create and apply our indexes
prop
properties
Utility facade for getDocument()
Document Object Location, Searching and Query Utils ***************************************
criteria
Deletes a document by ID
_id
Evaluate our properties for the default document
Evicts the document entity and clears the query arguments
SETTERS **********************************
prop
Load a record by _id
_id
returnInstance
Returns the Mongo.Collection object for advanced operations facade for getDBInstance()
Returns a CFML copy of the loaded document
Returns the document path for a given property name or key
key
Returns the normalized data for a normalization key
key
Returns the default property value Used to populate the document defaults
prop
suffix
Determines whether a property is a normalization key for another property
key
Alias for get()
_id
returnInstance
Helper function to locate deeply nested document items
key
SQL to Mongo ordering translations
order
Processes auto-normalization of a field
key
Populate the document object with a structure
document
Prepends to an existing array property
key
value
reset the document state
Sets a document property
key
value
_default_document
_document
_existing
_id
_map
_validation
appSettings
collection
db
dbInstance
logbox
MongoClient
MongoIndexer
MongoUtil
wirebox
Handles correct formatting of geoJSON objects
coordinates
type
facade for Mongo.Util.toMongo
arg
facade for Mongo.Util.toMongoDocument
arg