{"_id":"@alt-javascript/jsnosqlc-mongodb","_rev":"3-125207e7ff8bc64f0e2fc846ae24d4e0","name":"@alt-javascript/jsnosqlc-mongodb","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@alt-javascript/jsnosqlc-mongodb","version":"1.0.0","keywords":["jsnoslqc","nosql","mongodb","driver","database"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-mongodb@1.0.0","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/mongodb#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"af745f4a282291d3cb426c87ac4e1f6caeacd2f7","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-mongodb/-/jsnosqlc-mongodb-1.0.0.tgz","fileCount":8,"integrity":"sha512-VwB4pqNg3ssb6QEP2qqpLmsxRJSUMvnKWk/nsR1UgTXJlRxwlRtwN6DHDCCps3R8mNweiYXd5ZIPzcg1Y6f4Gw==","signatures":[{"sig":"MEQCIC51gvd3R4kH133oKM/0IpQgEHklmTsFYaOjjBLUmDUPAiA4y6oDf9MY6nW0hoxyhTGKbX3MTdFe68bFsjxSKvXlag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-mongodb@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14501},"main":"index.js","type":"module","gitHead":"80cfedbe5f530e7635cfab7c720cbc230731406c","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 10000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/mongodb"},"_npmVersion":"10.8.2","description":"JSNOSLQC MongoDB driver via the official mongodb npm package","directories":{},"_nodeVersion":"20.20.1","dependencies":{"mongodb":"^6.3.0","@alt-javascript/jsnosqlc-core":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnosqlc-mongodb_1.0.0_1774353596403_0.030294783865003394","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alt-javascript/jsnosqlc-mongodb","version":"1.0.1","keywords":["jsnosqlc","nosql","mongodb","driver","database"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-mongodb@1.0.1","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/mongodb#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"0ea59570df9a293009fd31eaad46db173a10115e","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-mongodb/-/jsnosqlc-mongodb-1.0.1.tgz","fileCount":8,"integrity":"sha512-egpHRJsrGYxDJ4EN3PizWP1Pu8/D+nChrtXh2GbcE8UtCIlmJk0bJlJdc9HS3w/Op9McqOHWXfnUS6e+Ut7Eww==","signatures":[{"sig":"MEUCIQCYmzUZS34Vqx1f/OEx3AwIqj5vBR6vU270xODC2zYhFwIgDZXkwHB+IBKnccFzSOYUEnnlCwawib4SAbQDeRcO1+U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-mongodb@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14501},"main":"index.js","type":"module","gitHead":"8aa2fa0b3c0e0ab1bf7252b331fd5f468690fcf1","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 10000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/mongodb"},"_npmVersion":"10.8.2","description":"JSNOSLQC MongoDB driver via the official mongodb npm package","directories":{},"_nodeVersion":"20.20.1","dependencies":{"mongodb":"^6.3.0","@alt-javascript/jsnosqlc-core":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnosqlc-mongodb_1.0.1_1774354020025_0.09742584888244554","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/jsnosqlc-mongodb","version":"1.1.1","description":"JSNOSLQC MongoDB driver via the official mongodb npm package","keywords":["jsnosqlc","nosql","mongodb","driver","database"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/mongodb#readme","repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/mongodb"},"type":"module","main":"index.js","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 10000"},"dependencies":{"@alt-javascript/jsnosqlc-core":"*","mongodb":"^6.3.0"},"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"author":{"name":"Craig Parravicini"},"contributors":[{"name":"Claude","url":"Anthropic"}],"license":"MIT","_id":"@alt-javascript/jsnosqlc-mongodb@1.1.1","gitHead":"20256a64a39eb4643b126a3996f360ade0aad2da","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-1sFX2EBTmJO0RtRW2/aroJHX++wqYGxI4c0wq4h6AUjMlWIarh/6T4e88n7hdd5t3azwXNr4eDoHvLDsl7Mt9g==","shasum":"3928733ed5015d1012652ab1b4230383c14b2a48","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-mongodb/-/jsnosqlc-mongodb-1.1.1.tgz","fileCount":8,"unpackedSize":14501,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-mongodb@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD80VEfRpNf4Wvgra4FuBBeh2LtyHIRunhh9LLyrHaGNAIgK0zUk/JKIvMUgrVreTJeA0OBLy5u4zpqfbl8pawLvIE="}]},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"directories":{},"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jsnosqlc-mongodb_1.1.1_1774503249365_0.5578505451122477"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T11:59:56.027Z","modified":"2026-03-26T05:34:09.777Z","1.0.0":"2026-03-24T11:59:56.557Z","1.0.1":"2026-03-24T12:07:00.193Z","1.1.1":"2026-03-26T05:34:09.514Z"},"bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"author":{"name":"Craig Parravicini"},"license":"MIT","homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/mongodb#readme","keywords":["jsnosqlc","nosql","mongodb","driver","database"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/mongodb"},"description":"JSNOSLQC MongoDB driver via the official mongodb npm package","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"# @alt-javascript/jsnosqlc-mongodb\n\n[![Language](https://img.shields.io/badge/language-JavaScript-yellow.svg)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)\n[![npm version](https://img.shields.io/npm/v/%40alt-javascript%2Fjsnosqlc-mongodb)](https://www.npmjs.com/package/@alt-javascript/jsnosqlc-mongodb)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/alt-javascript/jsnosqlc/actions/workflows/node.js.yml/badge.svg)](https://github.com/alt-javascript/jsnosqlc/actions/workflows/node.js.yml)\n\nJSNOSLQC driver for MongoDB via the official [mongodb](https://www.npmjs.com/package/mongodb) Node.js driver.\n\n**Part of the [@alt-javascript/jsnosqlc](https://github.com/alt-javascript/jsnosqlc) monorepo.**\n\n## Install\n\n```bash\nnpm install @alt-javascript/jsnosqlc-core @alt-javascript/jsnosqlc-mongodb\n```\n\n## Usage\n\n```javascript\nimport { DriverManager, Filter } from '@alt-javascript/jsnosqlc-core';\nimport '@alt-javascript/jsnosqlc-mongodb'; // self-registers with DriverManager\n\nconst client = await DriverManager.getClient('jsnosqlc:mongodb://localhost:27017/mydb');\nconst products = client.getCollection('products');\n\n// Store and retrieve\nawait products.store('p1', { name: 'Widget', price: 9.99, tags: ['hardware'] });\nconst p = await products.get('p1'); // { name: 'Widget', price: 9.99, tags: ['hardware'] }\n\n// Insert with auto-assigned id\nconst id = await products.insert({ name: 'Gadget', price: 24.99 });\nawait products.update(id, { price: 19.99 }); // partial update — other fields preserved\n\n// Query\nconst filter = Filter.where('price').lt(15).and('tags').contains('hardware').build();\nconst cursor = await products.find(filter);\nfor await (const doc of cursor) {\n  console.log(doc.name, doc.price);\n}\n\nawait client.close();\n```\n\n## URL Scheme\n\n```\njsnosqlc:mongodb://<host>:<port>/<database>\n```\n\n| URL | Description |\n|---|---|\n| `jsnosqlc:mongodb://localhost:27017/mydb` | Local MongoDB |\n| `jsnosqlc:mongodb://user:pass@host:27017/mydb` | With credentials |\n| `jsnosqlc:mongodb+srv://cluster.mongodb.net/mydb` | MongoDB Atlas |\n\n## Connection Properties\n\nPass additional options as the second argument to `DriverManager.getClient()`:\n\n```javascript\nconst client = await DriverManager.getClient(\n  'jsnosqlc:mongodb://localhost:27017/mydb',\n  { maxPoolSize: 10, connectTimeoutMS: 5000 }\n);\n```\n\nProperties are passed directly to the underlying `MongoClient` options.\n\n## ClientDataSource\n\n```javascript\nimport { ClientDataSource } from '@alt-javascript/jsnosqlc-core';\nimport '@alt-javascript/jsnosqlc-mongodb';\n\nconst ds = new ClientDataSource({\n  url: 'jsnosqlc:mongodb://localhost:27017/mydb',\n  username: 'user',\n  password: 'pass',\n});\nconst client = await ds.getClient();\n```\n\n## Local Development with Docker\n\n```bash\ndocker run --rm -d -p 27017:27017 mongo:7\n```\n\n## Filter Translation\n\nThe MongoDB driver translates the JSNOSLQC Filter AST to native MongoDB query operators:\n\n| JSNOSLQC | MongoDB |\n|---|---|\n| `eq` | `{ field: value }` |\n| `ne` | `{ field: { $ne: value } }` |\n| `gt` / `gte` | `{ field: { $gt/$gte: value } }` |\n| `lt` / `lte` | `{ field: { $lt/$lte: value } }` |\n| `contains` | `{ field: value }` (native array element match) |\n| `in` | `{ field: { $in: [...] } }` |\n| `nin` | `{ field: { $nin: [...] } }` |\n| `exists` | `{ field: { $exists: bool } }` |\n| `and` | `{ $and: [...] }` |\n| `or` | `{ $or: [...] }` |\n| `not` | `{ $nor: [cond] }` |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}