DoboExtra

DoboExtra class definition

This class provides more functionality to the Dobo plugin including:

  • new additional ndjson format for Bajo's configHandlers
  • data import/export from/to file system in various formats (JSON, NDJSON, CSV, TSV, XLSX)

Constructor

new DoboExtra()

Members

config :TConfig

Configuration object

Type:
  • TConfig

Methods

(async) exportTo(source, dest, options) → {Promise.<object>}

Export data from a Dobo model into a file

Parameters:
NameTypeDescription
sourcestring

Source model name

deststring

Destination file path (absolute or relative to plugin data dir)

optionsobject

Export options

Properties
NameTypeAttributesDefaultDescription
filterobject<optional>
{}

Filter object to select records to export

ensureDirboolean<optional>

Whether to create the destination directory if it doesn't exist

useHeaderboolean<optional>
true

Whether to include the header row (for CSV/TSV/XLSX)

batchnumber<optional>
500

Number of records to export in a single batch

progressFnfunction<optional>

Callback function to report progress

fieldsArray.<string><optional>

List of fields to include in the export

parserOptsobject<optional>
{}

Options for the parser (e.g., CSV delimiter)

Returns:
  • Export summary including file path and record count affected
Type: 
Promise.<object>

(async) importFrom(source, dest, options) → {Promise.<(object|array)>}

Import data from a file into a Dobo model

Parameters:
NameTypeDescription
sourcestring

Source file path (absolute or relative to plugin data dir)

deststring | boolean

Destination model name or false. If false, the data will be returned instead of being imported into a model.

optionsobject

Import options

Properties
NameTypeAttributesDefaultDescription
trashOldboolean<optional>
true

Whether to clear the destination model before importing

batchnumber<optional>
100

Number of records to import in a single batch.

progressFnfunction<optional>

Callback function to report progress

converterFnfunction<optional>

Callback function to convert each record before importing

useHeaderboolean<optional>
true

Whether to use the first row as header (for CSV/TSV/XLSX)

fileTypestring<optional>

File type (json, ndjson, csv, tsv, xlsx)

Returns:
  • Imported data or summary report including file path and record count affected
Type: 
Promise.<(object|array)>

Type Definitions

TConfig

Type:
  • object
Properties
NameTypeDescription
exportobject

Export configuration

Properties
NameTypeDescription
maxBatchnumber

Maximum number of records to export in a single batch

stringifyobject

Stringify options for exported data

Properties
NameTypeDescription
openstring

Opening string for exported data

sepstring

Separator string for exported data

closestring

Closing string for exported data

importobject

Import configuration

Properties
NameTypeDescription
maxBatchnumber

Maximum number of records to import in a single batch