mongodb-query-parser
JSON →Safely parse and validate MongoDB query strings (filters, projections, sort, etc.) into BSON-typed JavaScript objects. Current stable version is 4.7.12. Released as part of MongoDB DevTools Shared, with active maintenance and minor releases as needed. Supports ESM and CJS, ships TypeScript types, and integrates with Codemirror for syntax highlighting detection. Key differentiator: lossless BSON type handling (e.g., ObjectId, ISODate) from string input, unlike naive JSON.parse.
Resources
packagemongodb-query-parser ↗
API endpoints
full doc /v1/registry/mongodb-query-parser