Utility to convert simple MongoDB query documents into equivalent MySQL SQL statements. Version 1.2.4 is the latest stable release; development appears stalled (no updates since 2019). Supports insert, update, and select with basic operators ($in, $nin, $eq, $ne, $gte, $gt, $lte, $lt) and update modifiers ($set, $inc). Lacks support for $or, $and, $not, nested documents, arrays, or projection. Outputs raw SQL strings without parameterization, posing SQL injection risk. Only works with CommonJS; no TypeScript typings.
npm install mongo-to-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Installs package, converts a MongoDB insert document into an SQL INSERT and a MongoDB update with $gt into a MySQL UPDATE.
Sanitize inputs manually or use parameterized queries; avoid passing untrusted data.
Flatten documents before conversion or choose a more advanced library.
Do not rely on complex query logic; handle compound conditions manually.
Consider using a more actively maintained library or writing queries directly.
Use dynamic import() if needed in ESM projects, but prefer a modern alternative.
Use const MoMy = require('mongo-to-mysql').Rewrite query using supported operators or handle logic manually.
Ensure all values are primitives (strings, numbers, booleans).
No dependency data recorded yet.