{"_id":"@alt-javascript/jsnosqlc-firestore","_rev":"3-7c470abfb571e0b12fa20c26129a4ba6","name":"@alt-javascript/jsnosqlc-firestore","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@alt-javascript/jsnosqlc-firestore","version":"1.0.0","keywords":["jsnoslqc","nosql","firestore","google","gcp","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-firestore@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/firestore#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"dc3cb247e92201edef6aeb62e85eccfbcf77368c","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-firestore/-/jsnosqlc-firestore-1.0.0.tgz","fileCount":8,"integrity":"sha512-rGbUs9x1QdIKT1WAeoGXQpvsXEhyMq7sOXxV1YoFwKW2BPnz/ygLtfCD/LxrwM6Tj9TZxbYdN3z1eRD8Qz45Dw==","signatures":[{"sig":"MEUCIEWEXmIJW3S66iDvja2aNWKh52NBOouY41aM5OUWGNwjAiEA17vqaiLQj9TAPNGwZtlsipK3tlI9/LwAAV8EmHjyCaY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-firestore@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15918},"main":"index.js","type":"module","gitHead":"80cfedbe5f530e7635cfab7c720cbc230731406c","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 30000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/firestore"},"_npmVersion":"10.8.2","description":"JSNOSLQC Google Firestore driver via @google-cloud/firestore","directories":{},"_nodeVersion":"20.20.1","dependencies":{"@google-cloud/firestore":"^8.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-firestore_1.0.0_1774353602605_0.9559729393963174","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alt-javascript/jsnosqlc-firestore","version":"1.0.1","keywords":["jsnosqlc","nosql","firestore","google","gcp","driver"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/jsnosqlc-firestore@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/firestore#readme","bugs":{"url":"https://github.com/alt-javascript/jsnosqlc/issues"},"dist":{"shasum":"15517ac371be4da64b1443067cdce49c87059997","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-firestore/-/jsnosqlc-firestore-1.0.1.tgz","fileCount":8,"integrity":"sha512-XrfoUZ1Ai69zM3obgm9PMWke1v4l5Hc3opNjlvn4EmCxQxzldaee+eenBA7cYB5eLdtpnHv4Gil1LnfOeXVHqQ==","signatures":[{"sig":"MEUCIQC7crlTJMy+LrMItDRBUjaTl+re/UZAiGe3Ds0hE3SNYgIge9N2KJWOIrRPXbWc5nsZ2zFmRXvAPBbDBrcMI5HzZL0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-firestore@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15918},"main":"index.js","type":"module","gitHead":"8aa2fa0b3c0e0ab1bf7252b331fd5f468690fcf1","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 30000"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/jsnosqlc.git","type":"git","directory":"packages/firestore"},"_npmVersion":"10.8.2","description":"JSNOSLQC Google Firestore driver via @google-cloud/firestore","directories":{},"_nodeVersion":"20.20.1","dependencies":{"@google-cloud/firestore":"^8.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-firestore_1.0.1_1774354025688_0.5451967208813879","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/jsnosqlc-firestore","version":"1.1.1","description":"JSNOSLQC Google Firestore driver via @google-cloud/firestore","keywords":["jsnosqlc","nosql","firestore","google","gcp","driver"],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"homepage":"https://github.com/alt-javascript/jsnosqlc/tree/main/packages/firestore#readme","repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/firestore"},"type":"module","main":"index.js","scripts":{"test":"mocha --recursive 'test/**/*.spec.js' --timeout 30000"},"dependencies":{"@alt-javascript/jsnosqlc-core":"*","@google-cloud/firestore":"^8.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-firestore@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-ty4xrUq5CUssT+vHSMFTExw9cn+DcnbyGguWiT/78sVmetw8BYgt4laRSTVTDHkFoWULLYAqpat5VEACcU2HOA==","shasum":"24ed5c376dca1dc6ed121d7211682a9c7f35d1e6","tarball":"https://registry.npmjs.org/@alt-javascript/jsnosqlc-firestore/-/jsnosqlc-firestore-1.1.1.tgz","fileCount":8,"unpackedSize":15918,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fjsnosqlc-firestore@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4LwyaSBJZvVr1fgSxZ9y6J+DpOvV4UZ8btwXiQ+sW4QIgXzxPW+Eo+csHDQUM5yjslbJWYQx8LWCSp1pBUIhMzds="}]},"_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-firestore_1.1.1_1774503254287_0.6423425772347595"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T12:00:02.539Z","modified":"2026-03-26T05:34:14.741Z","1.0.0":"2026-03-24T12:00:02.765Z","1.0.1":"2026-03-24T12:07:05.817Z","1.1.1":"2026-03-26T05:34:14.472Z"},"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/firestore#readme","keywords":["jsnosqlc","nosql","firestore","google","gcp","driver"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/jsnosqlc.git","directory":"packages/firestore"},"description":"JSNOSLQC Google Firestore driver via @google-cloud/firestore","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"# @alt-javascript/jsnosqlc-firestore\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-firestore)](https://www.npmjs.com/package/@alt-javascript/jsnosqlc-firestore)\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 Google Cloud Firestore via the [@google-cloud/firestore](https://www.npmjs.com/package/@google-cloud/firestore) Admin SDK.\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-firestore\n```\n\n## Usage\n\n```javascript\nimport { DriverManager, Filter } from '@alt-javascript/jsnosqlc-core';\nimport '@alt-javascript/jsnosqlc-firestore'; // self-registers with DriverManager\n\n// Firestore Emulator\nprocess.env.FIRESTORE_EMULATOR_HOST = 'localhost:8080';\nconst client = await DriverManager.getClient('jsnosqlc:firestore:my-project-id');\n\n// Google Cloud Firestore (production)\n// Set GOOGLE_APPLICATION_CREDENTIALS or use Application Default Credentials\nconst client = await DriverManager.getClient('jsnosqlc:firestore:my-project-id');\n\nconst events = client.getCollection('events');\n\nawait events.store('e1', { type: 'login', userId: 'u1', score: 100 });\nconst e = await events.get('e1');\n\nconst id = await events.insert({ type: 'click', userId: 'u2', score: 50 });\nawait events.update(id, { score: 75 });\n\nconst filter = Filter.where('score').gt(60).and('type').eq('login').build();\nconst cursor = await events.find(filter);\nfor await (const doc of cursor) {\n  console.log(doc.userId, doc.score);\n}\n\nawait client.close();\n```\n\n## URL Scheme\n\n```\njsnosqlc:firestore:<gcp-project-id>\n```\n\n| URL | Description |\n|---|---|\n| `jsnosqlc:firestore:my-project` | Production Firestore |\n| `jsnosqlc:firestore:emulator-project` | Firestore Emulator (set `FIRESTORE_EMULATOR_HOST`) |\n\n## Authentication\n\nFirestore uses Application Default Credentials (ADC):\n\n- **Locally:** `gcloud auth application-default login`, or set `GOOGLE_APPLICATION_CREDENTIALS` to a service account key file path\n- **GCP (Cloud Run, GKE, etc.):** Uses the default service account automatically\n- **Emulator:** Set `FIRESTORE_EMULATOR_HOST=localhost:8080` — no credentials needed\n\nTo specify a key file explicitly:\n\n```javascript\nconst client = await DriverManager.getClient('jsnosqlc:firestore:my-project', {\n  keyFilename: '/path/to/service-account.json',\n});\n```\n\n## Local Development with Docker\n\n```bash\ndocker run --rm -d \\\n  -e FIRESTORE_PROJECT_ID=my-project \\\n  -e PORT=8080 \\\n  -p 8080:8080 \\\n  mtlynch/firestore-emulator\n```\n\nThen set `FIRESTORE_EMULATOR_HOST=localhost:8080` before creating a client.\n\n## Filter Translation\n\nNative Firestore SDK filter queries are used for all supported operators. Unsupported operators fall back to in-memory filtering after a full collection fetch.\n\n| JSNOSLQC | Native Firestore | Notes |\n|---|---|---|\n| `eq` | `.where(field, '==', val)` | Native |\n| `ne` | `.where(field, '!=', val)` | Native |\n| `gt` / `gte` | `.where(field, '>' / '>=', val)` | Native |\n| `lt` / `lte` | `.where(field, '<' / '<=', val)` | Native |\n| `contains` | `.where(field, 'array-contains', val)` | Native |\n| `in` | `.where(field, 'in', [...])` | Native |\n| `nin` | `.where(field, 'not-in', [...])` | Native |\n| `exists` (true) | `.where(field, '!=', null)` | Approximation |\n| `and` | Chained `.where()` calls | Native |\n| `or` | Client-side | Firestore OR requires composite index |\n| `not` | Client-side | No native NOT |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}