-
Notifications
You must be signed in to change notification settings - Fork 83
Custom Operators
Francis edited this page Dec 2, 2024
·
27 revisions
Custom operators can be added with the useOperators(type, operatorMap) where
type
is the kind of operators to add, and operatorMap
is mapping of function names beginning with $
to their implementations for the specific operator type.
Once an operator has been registered the function referenced cannot be replaced. This ensures that behaviour of mingo
remain consistent at runtime.
Each operator type function has a different signature and must be registered correctly otherwise the result will be unexpected.
- AccumulatorOperator
- ExpressionOperator
- ProjectionOperator
- PipelineOperator
- WindowOperator
- QueryOperator
Pre-loaded operators defined here cannot be overridden. These include;
- All query operators.
- All projection operators.
- Expression operators for boolean and comparison.
- Pipeline operators;
$project
,$skip
,$limit
, and$sort
.