new DatabaseConfigProcessor(db)
The database config processor
Parameters:
Name | Type | Description |
---|---|---|
db |
Database | The database instance |
Methods
bind(name, fn)
Bind for a global event.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The event name |
fn |
function | The event function |
- Tutorials:
cache(cache)
Set the cache.
Parameters:
Name | Type | Description |
---|---|---|
cache |
Cache | The cache instance |
- Tutorials:
-
- Tutorial: set-cache s
register(collection)
Register a collection.
Parameters:
Name | Type | Description |
---|---|---|
collection |
DatabaseConfigProcessor~registerObject | The collection configuration object |
- Tutorials:
Type Definitions
registerEventsObject(validate, get, post, put, del, resolve)
Parameters:
Name | Type | Description |
---|---|---|
validate |
function | The validate event |
get |
function | The get event |
post |
function | The post event |
put |
function | The put event |
del |
function | The del event |
resolve |
function | The resolve event |
registerObject(name, schema, events)
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The collection name |
schema |
object | The validation schema |
events |
DatabaseConfigProcessor~registerEventsObject | The event modules for the collection |