Converts MongoDB-like query objects into SQL WHERE clauses or full SELECT statements, targeting DocumentDB and similar SQL databases. Version 0.2.1 is the latest, with infrequent releases. Supports most MongoDB query operators ($or, $and, $gt, $in, etc.) plus extras like $startsWith, $isArray, and $geoWithin. Designed for single-table queries, no joins. Lightweight with zero dependencies. Key differentiator: simple, direct translation without a query builder layer. Not actively maintained.
npm install sql-from-mongoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Convert a simple MongoDB-like filter to a SQL WHERE clause and a full SELECT statement.
Flatten nested queries manually or use $in for array fields explicitly via 'fieldName' syntax with an array value.
Always use an array for $in values unless intentionally referencing another field.
Consider migrating to a more active library like mongodb-query-to-sql or writing manual SQL.
Run 'npm install sql-from-mongo' in your project root.
Use 'import { sqlFromMongo } from 'sql-from-mongo'' or 'const { sqlFromMongo } = require('sql-from-mongo')'.Use require() or set 'type': 'module' in package.json.
No dependency data recorded yet.