mingledb
v1.0.4
Published
Lightweight file based NoSQL DB
Maintainers
Readme
MingleDB is a lightweight, file-based NoSQL database built on the BSON format. It supports basic authentication, schema validation, advanced query filters, and flat-file persistence, making it suitable for rapid prototyping, embedded use, CLI apps, or offline-first environments.
Installation
npm install mingledbFeatures
| Feature | Description |
| -------------------- | -------------------------------------------------------------------- |
| User Authentication | Register, login, logout, and session tracking |
| Schema Definition | Define required fields, types, and unique constraints per collection |
| Smart Querying | Supports filters like $gt, $in, $regex, and ranges |
| Compression | Stores entries compactly using BSON and zlib |
| Flatfile Storage | Saves data in .mingleDB files with binary headers and metadata |
| CRUD Operations | Simple create, read, update, and delete support |
| Minimal Dependencies | Runs anywhere Node.js is supported |
Example Usage
import MingleDB from "mingledb";
const db = new MingleDB();
// User authentication
db.registerUser("admin", "secure123");
db.login("admin", "secure123");
// Define schema
db.defineSchema("users", {
name: { type: "string", required: true },
email: { type: "string", required: true, unique: true },
age: { type: "number" },
});
// Insert document
db.insertOne("users", { name: "Wayne", email: "[email protected]", age: 25 });
// Query
console.log(db.findAll("users"));
console.log(db.findOne("users", { email: "[email protected]" }));
// Update and delete
db.updateOne("users", { name: "Wayne" }, { age: 26 });
db.deleteOne("users", { email: "[email protected]" });
// Logout
db.logout("admin");Use Cases
- Embedded or local-first databases
- Desktop applications
- CLI tools or utilities
- Offline-first storage
- Rapid prototyping with schema validation
- Lightweight backend for admin panels
Configuration
const db = new MingleDB("./data"); // Custom storage directoryCollections are stored as .mingleDB binary files with compressed BSON entries.
License
MIT © 2025 Mark Wayne Menorca
Feedback
Open issues or pull requests are welcome for improvements or bug reports.
