Renders the compiled filter AST to a Mongo filter object (no driver dependency).
Works with the MongoDB driver and Mongoose alike, since it returns plain objects.
Text matching becomes $regex; between → $gte/$lte; inArray → $in.
like/ilike translate the SQL LIKE pattern to a regex (%→.*, _→.).
The PG array ops map natively: arrayContains (@>) → $all, arrayOverlaps
(&&) → $in, and arrayContained (<@, field ⊆ values) → an $expr with
$setIsSubset (Mongo has no single-symbol “contained by” operator).
Compile a flat, AND-combined list of column filters into a Mongo filter object. Only fields in spec whose kind matches the filter’s kind are kept; the rest are silently dropped. filter is undefined when nothing survives, so pass filter ?? {} to find. A date preset filter needs resolveDate (it throws without one).
Compile a recursive and/or/notFilterNode tree into a Mongo filter object (or undefined). Same allow-list rules as buildFilter; not becomes $nor: [inner].
Render an already-compiled CompiledWhere AST (from compileFilters / compileFilterNode in @xtandard/lib/filters) to a Mongo filter object, looking each field up in paths. Conditions on fields missing from paths are dropped; null (or an AST that drops to nothing) gives undefined. and/or/not become $and/$or/$nor. Most code calls buildFilter, which compiles and renders in one step.
Allow-list a public field as an array filter over a document field path holding an array ("tags"). arrayContains → $all, arrayOverlaps → $in, and arrayContained → a top-level $expr with $setIsSubset.
Allow-list a public field as a date filter over a document field path ("createdAt", dot paths allowed) holding a Date. A date preset needs the resolveDate you pass to buildFilter, and becomes a half-open $gte/$lt window.
Allow-list a public field as a text filter over a document field path ("name", "address.city"). contains/startsWith/endsWith become a case-insensitive $regex (input escaped); like/ilike patterns are translated to a regex.