A TypeScript module for interacting with Nano databases
Interfaces
- NanoFlags
Extended repository flags that include user authentication information for Nano database connections
Members
Methods
# static createdByOnNanoCreateUpdate(this, context, data, key, model) → {Promise.<void>}
Callback function used in decorators to automatically set the created_by or updated_by fields with the username from the context when a document is created or updated
Sets the creator or updater field in a model based on the user in the context
Parameters:
Name | Type | Description |
---|---|---|
this |
R
|
The repository instance |
context |
Context.<NanoFlags>
|
The operation context containing user information |
data |
V
|
The relation metadata |
key |
The property key to set with the username |
|
model |
M
|
The model instance being created or updated |
A promise that resolves when the operation is complete
Promise.<void>
Type Definitions
object
# NanoConfig
Defines the necessary parameters to establish a connection to a Nano (CouchDB) server and select a database
Connection configuration for Nano
Properties:
Name | Type | Description |
---|---|---|
user |
string
|
Username to authenticate against the server |
password |
string
|
Password to authenticate the user |
host |
string
|
Host and port of the server (e.g., "localhost:5984") or full URL host without protocol |
dbName |
string
|
The database name to use on the server |
user |
string
|
|
password |
string
|
|
host |
string
|
|
dbName |
string
|