@cbnsndwch/zero-sources

SimpleTableMapping interface

Home > @cbnsndwch/zero-contracts > SimpleTableMapping

SimpleTableMapping interface

Legacy filter-based table mapping configuration (backward compatible).

This approach supports simple filtering and projection operations. It remains fully supported for existing configurations.

Signature:

interface SimpleTableMapping<TTable = Dict>

Example

const mapping: TableMapping<IAccount> = {
    source: 'accounts',
    filter: { bundle: 'ENTERPRISE' },
    projection: { _id: 1, name: 1, bundle: 1 }
};

Properties

Property

Modifiers

Type

Description

filter?

Filter<TTable>

(Optional) MongoDB filter to apply

pipeline?

never

(Optional)

projection?

Projection<TTable>

(Optional) MongoDB-like projection to apply. Both include/exclude (1 | 0) and simple renaming ($sourceField) syntaxes are supported.

Supports: - Include/exclude: { field: 1 } or { field: 0 } - Field reference: { field: '$otherField' } - Projection operators: { field: { $concat: ['$a', '$b'] } }

source

string

MongoDB collection name

How was this page?