MongoParameters
Class: MongoParameters
Defined in: mongodb/src/mongodb.service.ts:18
MongoDB store parameters
Extends
StoreParameters
Constructors
Constructor
new MongoParameters():
MongoParameters
Returns
MongoParameters
Inherited from
StoreParameters.constructor
Properties
collection
collection:
string
Defined in: mongodb/src/mongodb.service.ts:38
Which collection to use
All the models managed by the store share this collection, the __type
field is used to differentiate them
database?
optionaldatabase?:string
Defined in: mongodb/src/mongodb.service.ts:42
Database to use, default to the one defined in the URL
databaseOptions?
optionaldatabaseOptions?:DbOptions
Defined in: mongodb/src/mongodb.service.ts:48
Mongo Database Options
See
https://www.npmjs.com/package/mongodb
defaultModel?
optionaldefaultModel?:boolean
Defined in: core/lib/stores/store.d.ts:218
When __type model not found, use the model If strict is setup this parameter is not used
Default
true
Inherited from
StoreParameters.defaultModel
forceModel?
optionalforceModel?:boolean
Defined in: core/lib/stores/store.d.ts:224
If set, Store will ignore the __type
Default
false
Inherited from
StoreParameters.forceModel
modelAliases?
optionalmodelAliases?:object
Defined in: core/lib/stores/store.d.ts:234
Model Aliases to allow easier rename of Model
Index Signature
[key: string]: string
Inherited from
StoreParameters.modelAliases
models?
optionalmodels?:string[]
Defined in: core/lib/stores/store.d.ts:202
Models managed by this Store.
Default
["Webda/RegistryEntry"]
Inherited from
StoreParameters.models
mongoUrl?
optionalmongoUrl?:string
Defined in: mongodb/src/mongodb.service.ts:24
Contains the URL to Mongo Server
Will try to use WEBDA_MONGO_URL environment variable if not defined
noCache?
optionalnoCache?:boolean
Defined in: core/lib/stores/store.d.ts:240
Disable default memory cache
Inherited from
StoreParameters.noCache
options?
optionaloptions?:any
Defined in: mongodb/src/mongodb.service.ts:31
Additional options for Mongo connetion
Should be typed with MongoClientOptions but not available due to bug in ts-json-schema-generator https://docs.mongodb.com/manual/reference/connection-string
slowQueryThreshold
slowQueryThreshold:
number
Defined in: core/lib/stores/store.d.ts:230
Slow query threshold
Default
30000
Inherited from
StoreParameters.slowQueryThreshold
strict?
optionalstrict?:boolean
Defined in: core/lib/stores/store.d.ts:211
Allow to load object that does not have the type data
If set to true, then the Store will only managed the defined _model and no model extending this one
Default
false
Inherited from
StoreParameters.strict
type
type:
string
Defined in: core/lib/services/serviceparameters.d.ts:8
Type of the service
Inherited from
StoreParameters.type
Methods
load()
load(
params?):this
Defined in: mongodb/src/mongodb.service.ts:55
Parameters
params?
any = {}
raw parameters
Returns
this
this
Overrides
StoreParameters.load
update()
update(
params,delta):this
Defined in: core/lib/services/serviceparameters.d.ts:25
Update parameters and call watchers if a parameter was changed
Parameters
params
any
the service parameters
delta
any
the delta
Returns
this
this for chaining
Inherited from
StoreParameters.update
with()
with(
callback):this
Defined in: core/lib/services/serviceparameters.d.ts:31
Watch for changes on the parameters and call watchers when a parameter is changed
Parameters
callback
(params) => void
the callback function
Returns
this
this for chaining
Inherited from
StoreParameters.with