MongoDB Query parser and custom resolver
This is a monorepo containing:
- packages/mongoresolve - The main library package that exports the
MongoResolveclass - packages/test-project - Integration tests and examples of using the library
npm installBuild all packages:
npm run buildRun all tests:
npm testThis project uses Prettier with a tab width of 4 spaces.
Check formatting:
npm run format:checkFormat code:
npm run formatThe mongoresolve library works in both Node.js and browser environments.
const { MongoResolve } = require('mongoresolve');
const resolver = new MongoResolve({ name: 'John' });
console.log(resolver.getQuery());import { MongoResolve } from 'mongoresolve';
const resolver = new MongoResolve({ name: 'John' });
console.log(resolver.getQuery());For more details, see the library README.
The library is built with TypeScript and generates both CommonJS and ESM outputs to support various environments:
- CommonJS (
dist/cjs) - For Node.js require() - ESM (
dist/esm) - For modern import statements - Type definitions (
dist/types) - TypeScript declarations
MIT