{"_id":"@alt-javascript/jsnosqlc-redis","_rev":"3-28d8ec60c21045040c52e1178a02459f","name":"@alt-javascript/jsnosqlc-redis","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@alt-javascript/jsnosqlc-redis","version":"1.0.0","keywords":["jsnoslqc","nosql","redis","key-value","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-redis@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/redis#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"4569d33de23975875b062a6c2f7044aadef95700","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-redis/-/jsnosqlc-redis-1.0.0.tgz","fileCount":7,"integrity":"sha512-UDbZWIHuAAovj8kylw3aBeSl0OzMkTFzEE9mlBWFj6QEmejHS1VXQA+Bl9RK9IPFmGI8tUsKR1kq5Ex0tyT5hg==","signatures":[{"sig":"MEQCIEkmU34+KP6J8kTXKqC0O4tkADJ3nr1gV9vqme7mChOGAiBKfLkWBxeEcxxdCmHQG8oZqVTdHruqoL/MOpqSv0wIWA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-redis@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11822},"main":"index.js","type":"module","gitHead":"80cfedbe5f530e7635cfab7c720cbc230731406c","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 15000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.8.2","description":"JSNOSLQC Redis driver via ioredis","directories":{},"_nodeVersion":"20.20.1","dependencies":{"ioredis":"^5.10.1","@alt-javascript/jsnosqlc-core":"*","@alt-javascript/jsnosqlc-memory":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnosqlc-redis_1.0.0_1774353608013_0.20534328284896186","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alt-javascript/jsnosqlc-redis","version":"1.0.1","keywords":["jsnosqlc","nosql","redis","key-value","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-redis@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/redis#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"fc6e1849fb82a66d51ac2255746a79792f33b116","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-redis/-/jsnosqlc-redis-1.0.1.tgz","fileCount":7,"integrity":"sha512-/WSDrPy7oh2XhkEs0fmH2EEIELEMul7QNLWqbYygayatDVlJwoMiv7yZjA4y77rqCk+X7UHbBXwvYaMQNDVCqQ==","signatures":[{"sig":"MEUCIQDf43vXBeLwu0Libn27yC7L8JJcRa0XgozAxRBFW0d9XAIgL9MMKFtJbmAgo9FULFzahTI5AVdAteeOIkTWI/lki8Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-redis@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11822},"main":"index.js","type":"module","gitHead":"8aa2fa0b3c0e0ab1bf7252b331fd5f468690fcf1","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 15000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/redis"},"_npmVersion":"10.8.2","description":"JSNOSLQC Redis driver via ioredis","directories":{},"_nodeVersion":"20.20.1","dependencies":{"ioredis":"^5.10.1","@alt-javascript/jsnosqlc-core":"*","@alt-javascript/jsnosqlc-memory":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jsnosqlc-redis_1.0.1_1774354031390_0.06168641246601836","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/jsnosqlc-redis","version":"1.1.1","description":"JSNOSLQC Redis driver via ioredis","keywords":["jsnosqlc","nosql","redis","key-value","driver"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/redis#readme","repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/redis"},"type":"module","main":"index.js","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 15000"},"dependencies":{"@alt-javascript/jsnosqlc-core":"*","@alt-javascript/jsnosqlc-memory":"*","ioredis":"^5.10.1"},"devDependencies":{"chai":"^4.3.7","mocha":"^10.2.0"},"author":{"name":"Craig Parravicini"},"contributors":[{"name":"Claude","url":"Anthropic"}],"license":"MIT","_id":"@alt-javascript/jsnosqlc-redis@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-kJcV4i8ctg2zRlvzH4E1s6c6F7B/eHErbh9mggxFH5PKLOeNNT5jsSb3mjkBuemJi4Fka5FUL5qxyLey50sOtQ==","shasum":"6ea55c5ebb88dd1fb699d5324cdab14ec46dad6b","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-redis/-/jsnosqlc-redis-1.1.1.tgz","fileCount":7,"unpackedSize":11822,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-redis@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCtPg8Ic2qwQB8TCXQALrq7HYJ4KNV5SEKixIQl6wHaUAIgNaJUDtRhTMT/abw1JqoI6cckdrpfnlZ7DE/JBePpkmM="}]},"_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-redis_1.1.1_1774503258602_0.7062694187801284"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T12:00:07.922Z","modified":"2026-03-26T05:34:19.114Z","1.0.0":"2026-03-24T12:00:08.158Z","1.0.1":"2026-03-24T12:07:11.531Z","1.1.1":"2026-03-26T05:34:18.740Z"},"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/redis#readme","keywords":["jsnosqlc","nosql","redis","key-value","driver"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/redis"},"description":"JSNOSLQC Redis driver via ioredis","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"# @alt-javascript/jsnosqlc-redis\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-redis)](https://www.npmjs.com/package/@alt-javascript/jsnosqlc-redis)\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 Redis via [ioredis](https://www.npmjs.com/package/ioredis).\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-redis\n```\n\n## Usage\n\n```javascript\nimport { DriverManager, Filter } from '@alt-javascript/jsnosqlc-core';\nimport '@alt-javascript/jsnosqlc-redis'; // self-registers with DriverManager\n\nconst client = await DriverManager.getClient('jsnosqlc:redis://localhost:6379');\nconst sessions = client.getCollection('sessions');\n\n// Store and retrieve\nawait sessions.store('sess-1', { userId: 'u1', token: 'abc123', active: true });\nconst sess = await sessions.get('sess-1');\n\n// Insert with auto-assigned id\nconst id = await sessions.insert({ userId: 'u2', token: 'xyz789', active: true });\n\n// Patch specific fields\nawait sessions.update('sess-1', { active: false });\n\n// Query — full collection scan + in-memory filter (see note below)\nconst filter = Filter.where('active').eq(true).build();\nconst cursor = await sessions.find(filter);\nconst active = cursor.getDocuments();\n\nawait client.close();\n```\n\n> ⚠ **`find()` performs a full collection scan.** All documents in the collection are fetched\n> and filtered in-memory. This is suitable for small datasets and development. For production\n> filter queries, use [RediSearch](https://redis.io/docs/stack/search/).\n\n## URL Scheme\n\n```\njsnosqlc:redis://<host>:<port>[/<db>]\n```\n\n| URL | Description |\n|---|---|\n| `jsnosqlc:redis://localhost:6379` | Default database (0) |\n| `jsnosqlc:redis://localhost:6379/1` | Database index 1 |\n| `jsnosqlc:redis://:password@host:6379` | With password |\n\nThe `jsnosqlc:` prefix is stripped and the remainder is passed to ioredis.\n\n## Storage Layout\n\nDocuments are stored as JSON strings under namespaced keys:\n\n```\njsnosqlc:<collection>:<key>    → JSON string (document)\njsnosqlc:<collection>:_keys    → Redis Set (index of all keys in collection)\n```\n\nThe `_keys` Set enables `find()` to fetch all collection documents without a global `SCAN`.\n\n## ClientDataSource\n\n```javascript\nimport { ClientDataSource } from '@alt-javascript/jsnosqlc-core';\nimport '@alt-javascript/jsnosqlc-redis';\n\nconst ds = new ClientDataSource({\n  url: 'jsnosqlc:redis://localhost:6379',\n  properties: { connectTimeout: 5000 },\n});\nconst client = await ds.getClient();\n```\n\n## Local Development with Docker\n\n```bash\ndocker run --rm -d -p 6379:6379 redis:7\n```\n\n## When to Use Redis as a Document Store\n\nRedis is primarily a key-value and cache store. The JSNOSLQC Redis driver adds a thin document abstraction:\n\n- **Suitable for:** session state, ephemeral document storage, small collections where key-based access dominates\n- **Not suitable for:** large collections with complex filter queries, analytics, or data that outlives a Redis restart without persistence enabled\n\n## License\n\nMIT\n","readmeFilename":"README.md"}