{"_id":"0xdb","name":"0xdb","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"0xdb","version":"0.0.1","description":"Lightweight MongoDB key-value wrapper using Mongoose","main":"index.js","author":{"name":"ShadyMoon","email":"shady.js"},"license":"MIT","keywords":["mongodb","mongoose","key-value","database","lightweight","wrapper"],"repository":{"type":"git","url":"git+https://github.com/ShadyM00n/0xdb.git"},"bugs":{"url":"https://github.com/ShadyM00n/0xdb/issues"},"homepage":"https://github.com/ShadyM00n/0xdb#readme","dependencies":{"mongoose":"^8.14.2"},"_id":"0xdb@0.0.1","_nodeVersion":"23.6.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4vUGw7bsV7sVmnLWqVgqng1o2yYQedEKMZH0BMGqrz84qzledvIVbGYRRGVLTrGEbsxOtVguf1KA0wSNNDOh8w==","shasum":"7340afcdba6053ea437706e79b371962f6925e67","tarball":"https://registry.npmjs.org/0xdb/-/0xdb-0.0.1.tgz","fileCount":7,"unpackedSize":8531,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBHp98smPXAriBQd69RLI1lL7eJ2rvhZ9Z0zd7yHWlzQAiAyzPHo+S8XQ2sNyE0lSZTp2tDmCJQTvqasreJ/IDfQVw=="}]},"_npmUser":{"name":"shadymoon","email":"tccraven2020@gmail.com"},"directories":{},"maintainers":[{"name":"shadymoon","email":"tccraven2020@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/0xdb_0.0.1_1747004525789_0.294369401487274"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-11T23:02:05.788Z","0.0.1":"2025-05-11T23:02:05.994Z","modified":"2025-05-11T23:02:06.267Z"},"maintainers":[{"name":"shadymoon","email":"tccraven2020@gmail.com"}],"description":"Lightweight MongoDB key-value wrapper using Mongoose","homepage":"https://github.com/ShadyM00n/0xdb#readme","keywords":["mongodb","mongoose","key-value","database","lightweight","wrapper"],"repository":{"type":"git","url":"git+https://github.com/ShadyM00n/0xdb.git"},"author":{"name":"ShadyMoon","email":"shady.js"},"bugs":{"url":"https://github.com/ShadyM00n/0xdb/issues"},"license":"MIT","readme":"# 0xdb\n\n**0xdb** is a lightweight MongoDB key-value database wrapper built with Mongoose. Designed for simplicity and quick integration, it lets you store, retrieve, update, and delete key-value pairs in a MongoDB collection effortlessly.\n\n---\n\n## 🚀 Installation\n\n```bash\nnpm install 0xdb\n```\n\n---\n\n## 📦️ Usage\n\n```javascript\nconst { Schema, Database } = require(\"0xdb\");\n\nconst mySchema = new Schema({\n    username: String,\n    balance: Number\n});\n\nconst db = new Database({\n    url: \"mongodb://localhost/mydb\",\n    schema: mySchema,\n    table: \"users\"\n});\n\n(async () => {\n    await db.set(\"username\", \"ShadyMoon\");\n    await db.set(\"balance\", 998204294765477899);\n\n    console.log(await db.get(\"username\")); // ShadyMoon\n    console.log(await db.itemize()); // { username: \"ShadyMoon\", balance: 998204294765477899 }\n\n    await db.update(\"balance\", 1);\n    console.log(await db.get(\"balance\")); // 1\n\n    await db.delete(\"username\");\n})();\n```\n\n---\n\n## 📘 API\n\n### `new Database(config)`\nInitialize the database with a config object:\n- `url` (String): MongoDB connection URI.\n- `schema` (Mongoose.Schema): Your Mongoose Schema.\n- `table` (String): Collection name.\n\n\n### `set(key, value)`\nSets or updates a key-value pair.\n\n### `get(key)`\nGets the value of a key.\n\n### `delete(key)`\nDeletes a key-value pair. Returns `true` or `false`.\n\n### `update(key, value)`\nAlias for `set`.\n\n### `itemize()`\nReturns all stored values as a plain object.\n\n### `keys()`\nReturns an array of all keys defined in the schema.\n\n---\n\n## 📄 License\n\n[MIT](LICENSE) © [ShadyMoon](https://github.com/ShadyM00n)","readmeFilename":"README.MD","_rev":"1-30c4c99d060d3bd947b3e2c174a0c63f"}