Converts MongoDB query documents to PostgreSQL WHERE clauses for JSONB fields. Supports a wide range of MongoDB operators ($or, $and, $gt, $lt, $in, $regex, etc.), projections, updates ($set, $inc, $unset, $push, $pull, etc.), and sort. Current version 0.2.19 is stable and used by pgmongo. Differentiator: provides a drop-in-like experience for MongoDB developers querying JSONB columns in Postgres.
npm install mongo-query-to-postgres-jsonbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a MongoDB query with $gte, $or, and equality to a parameterized PostgreSQL WHERE clause for a JSONB column.
Provide arrayFields option with dot-separated paths to array fields.
Check the list of supported operators in the documentation; avoid geo operators.
Use the object return value: const { where, params } = mToPsql(...).Use the explicit $regex and $options syntax.
Use 'import mToPsql from "mongo-query-to-postgres-jsonb"' (default import).
Run 'npm install mongo-query-to-postgres-jsonb' or check spelling.
Remove unsupported operators or implement custom handling manually.
No dependency data recorded yet.