mniam is a small, opinionated MongoDB facade for the official Node.js native driver (mongodb). Version 5.1.0 wraps the driver's MongoClient to simplify URI parsing, connection management, and collection operations. It provides a lightweight API for CRUD, cursors (with async iteration, toArray, eachSeries, eachLimit), and aggregation pipelines. Key differentiators: minimal abstraction, automatic index creation, and fluent cursor/aggregation builders. Release cadence is sporadic; last update was 2022. Suitable for small projects seeking a thin wrapper without ODM features.
npm install mniamNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to a MongoDB instance, creates a collection with an index, inserts a document, queries using async iteration, and performs an aggregation pipeline.
Upgrade to mniam@3.x and adapt collection creation calls to use single object parameter.
Upgrade mongodb to v4.x or v5.x in your dependencies.
Replace .eachSeries(fn) with for await...of loop over .items() or .toArray()
Call db.close() in your shutdown logic (e.g., process.on('SIGINT', ...)).Use indexes: [[{ field: 1 }, { unique: true }]]npm install mniam
npm install mongodb@4.x
Check MongoDB connection string and ensure mongod is running.
Ensure collection config includes 'name' property: collection({ name: 'mycollection', indexes: [] })