QuickMongo
Quick Mongodb wrapper for beginners that provides key-value based interface.
Installing
$ npm install --save quickmongo
Documentation
https://quickmongo.js.org
Features
- Beginner friendly
- Asynchronous
- Dot notation support
- Key-Value like interface
- Easy to use
- TTL (temporary storage) supported
Example
import { Database } from "quickmongo";
const db = new Database("mongodb://localhost:27017/quickmongo");
db.on("ready", () => {
console.log("Connected to the database");
doStuff();
});
await db.connect();
async function doStuff() {
await db.set("userInfo", { difficulty: "Easy" });
await db.push("userInfo.items", "Sword");
await db.add("userInfo.balance", 500);
await db.push("userInfo.items", "Watch");
await db.add("userInfo.balance", 500);
await db.get("userInfo.balance");
await db.get("userInfo.items");
await db.pull("userInfo.items", "Sword");
await db.set("foo", "bar", 60);
setTimeout(async () => {
await db.get("foo");
}, 60_000);
}
Created and maintained by CesiumLabs
Discord Support
CesiumLabs