Methods

(async, static) getOneRecord(model, id, filteropt, optionsopt) → {Promise.<Object>}

Get a single record from the database based on the provided model, ID, filter, and options.

Parameters:
NameTypeAttributesDefaultDescription
modelexternal:DoboModel

The model to query

idstring | number

The ID of the record to retrieve

filterexternal:TFilter<optional>
{}

The filter criteria for the query

optionsexternal:TOptions<optional>
{}

Additional options for the query

Returns:

The retrieved record

Type: 
Promise.<Object>

(async, static) prepCrud(optionsopt) → {Object}

Prepare CRUD operation parameters.

Parameters:
NameTypeAttributesDefaultDescription
optionsObject<optional>
{}

Options for preparing CRUD operation

Properties
NameTypeAttributesDescription
modelstring | external:DoboModel

The model to operate on

idstring | number<optional>

The record ID

reqObject<optional>

The request object

replyObject<optional>

The reply object

transactionObject<optional>

The transaction object

optionsObject<optional>

Additional options

argsArray<optional>

Additional arguments

Returns:

Prepared CRUD parameters

Type: 
Object

(async, static) processHandler(optsopt)

Process a database operation with error suppression and transaction handling.

Parameters:
NameTypeAttributesDefaultDescription
optsObject<optional>
{}

Options for processing the handler

Properties
NameTypeAttributesDescription
actionstring

The action to perform (e.g., 'createRecord', 'updateRecord')

modelexternal:DoboModel

The model to operate on

handlerfunction

The handler function to execute

optionsexternal:TOptions<optional>

Additional options for the handler

Type Definitions

TActions

Type of actions that can be performed on records in the database.

Type:
  • Object
Properties
NameTypeDefaultDescription
0number'countRecord'

Count the number of records

1number'createAggregate'

Create an aggregate record

2number'createHistogram'

Create a histogram record

3number'createRecord'

Create a new record

4number'findAllRecord'

Find all records

5number'findOneRecord'

Find one record

6number'findRecord'

Find records

7number'getRecord'

Get a record

8number'removeRecord'

Remove a record

9number'updateRecord'

Update a record