A library that converts MongoDB-style query documents into knex.js query builder filters. Current version is 0.1.0, appears to be an early release with no recent updates. It supports common operators ($and, $or, $nor, $eq, $ne, $regex, $gt, $gte, $lt, $lte, $in, $nin, $not) and works by applying filter conditions to a knex query builder. Unlike direct MongoDB, it translates $regex to SQL LIKE, potentially with different semantics. It is a niche package for developers who prefer MongoDB query syntax while using SQL databases via knex. The package has low adoption and no recent maintenance, so users should assess stability.
npm install knex-doc-filterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates installing knex and knex-doc-filter, creating a knex connection, and applying a MongoDB-style filter to select active users aged 18+.
Consider using knex's native where methods or other query builder wrappers.
Review and adapt regex patterns to SQL LIKE wildcards (% and _).
Use import or const docFilter = require('knex-doc-filter').default.Consider writing a declaration file or using an alternative.
Use const docFilter = require('knex-doc-filter').default;Run npm install knex knex-doc-filter.
Check the client compatibility or avoid using $regex with limited clients.