firestore-pipelines

Builds and tests Firestore Pipelines API queries including joins, aggregations, and DML stages.

Updated May 13, 2026
One-click install
npx skills add https://github.com/Hinten/next_erp --skill firestore-pipelines-hinten
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firestore-pipelines
Source: https://github.com/Hinten/next_erp/tree/main/.claude/skills/firestore-pipelines
Command: npx skills add https://github.com/Hinten/next_erp --skill firestore-pipelines-hinten

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @google-cloud/firestore, firebase, firebase-admin, and includes references (resource) components.

What problem does it solve? Firestore's Pipelines API (Enterprise edition) has no emulator support, no auto-created indexes, and SDK spellings that diverge from the public docs, so developers silently full-scan billed data or write uncallable code. This Skill encodes the correct client and admin surfaces, indexing rules, and testing seams for this monorepo. ## Core Features & Use Cases - Pipeline vs classic query decisions: Choose between one-shot pipelines and realtime classic queries based on joins, aggregations, cursors, and emulator constraints. - Correlated subqueries and joins: Implement server-side lookups, per-parent arrays, anti-joins, and INNER-JOIN-shaped unnest using define/variable and toScalarExpression/toArrayExpression. - Indexing and testing guidance: Declare Enterprise indexes in firestore.indexes.json, verify them with explain analyze, and test pipeline code via mocks or dependency injection since the emulator cannot run pipelines. - Use Case: When adding a filtered, searchable table view in apps/web, use buildPipeline with PipelineSpec filters and select projections, falling back to a classic query only on PipelineUnsupportedError. ## Quick Start Ask the AI to build a Firestore pipeline query with filters, sorting, and accent-insensitive search for a collection in this repo, including the required index entry and a unit test.

Frequently Asked Questions about firestore-pipelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Firestore pipeline query with filters and search?

Use buildPipeline(db, spec) from packages/data with a PipelineSpec containing collection, filters, search, orderBy, select, and limit. Filters map to where stages and search becomes an accent-folded regexContains, with a rowId projection added automatically for row identity.

When should I use Firestore pipelines vs classic queries?

Use pipelines for joins, grouped aggregations, server-computed fields, unnest, and regex search that classic Query lacks. Stay on classic queries when you need realtime onSnapshot updates, cursor pagination, or emulator-based testing, since pipelines are one-shot and emulator-unsupported.

How do I perform a server-side join in Firestore?

Use a correlated subquery: define a variable from the outer document, then embed a nested pipeline via toScalarExpression for lookups or toArrayExpression for per-parent arrays. Correlate only through defined variables, since undefined variables are runtime errors while missing fields are silently absent.

Can Firestore pipelines run in the Firebase emulator?

No, pipelines never run in the emulator, including client pipelines, admin pipelines, and explain. Test client code by mocking firebase/firestore/pipelines, and test admin code with dependency-injected fetch functions stubbed in emulator suites.

Why does my Firestore pipeline query bill so much data scanned?

Firestore Enterprise auto-creates zero indexes, so an unindexed pipeline silently full-scans and bills data scanned. Add a matching entry to firestore.indexes.json, deploy it manually, and verify with execute explainOptions analyze that indexesUsed is non-empty.

What are the limitations of Firestore pipeline update and delete stages?

The update and delete DML stages are beta, admin-only, ignore Security Rules, cannot run in transactions, and fail on first error with partial success possible. They must be terminal stages over a where-filtered set, and a delete without a where wipes the collection.