toMongoFilter
toMongoFilter(
where,toField?):Record<string,unknown>
Defined in: mongo-filter.ts:40
Translate a Mantle QueryParams.where clause into a MongoDB filter document.
Most operators ($lt/$lte/$gt/$gte/$ne/$in/$nin/$or/$and) are native
MongoDB syntax and pass through unchanged; dot-path keys ("metadata.owner.name")
are native too. The two Mantle-specific translations:
idkeys become_id, with 24-hex string values converted toObjectId— the repository boundary only ever deals in string ids.$contains(jsonb@>semantics) becomes: scalar operand → field equality (MongoDB equality matches array elements natively), array operand →$all, object operand → recursively expanded dot-path conditions.
Parameters
Section titled “Parameters”toField?
Section titled “toField?”(field) => string
Returns
Section titled “Returns”Record<string, unknown>