feat(firestore): Support for Firestore pipelines API #8931
Open
russellwheatley wants to merge 135 commits intomainfrom
Open
feat(firestore): Support for Firestore pipelines API #8931russellwheatley wants to merge 135 commits intomainfrom
russellwheatley wants to merge 135 commits intomainfrom
Conversation
… and option types - Add arithmetic/constant helpers: constant, add, subtract, divide, multiply, documentId - Add aggregate helpers: sum, count, average, arrayAgg, countDistinct, first, last - Add math/conditional helpers: abs, ceil, floor, mod, round, conditional, sqrt, not, ifAbsent, ifError - Add string helpers: toLower, toUpper, trim, substring - Add concat, currentTimestamp - Add option/type exports: StageOptions, AliasedAggregate, AliasedExpression, AddFieldsStageOptions, AggregateStageOptions, ExpressionType - Match add() to SDK (two-arg only, no rest params)
… helpers - Declare ceil/round with (string) before (Expression) to match JS SDK - Add arrayAggDistinct, arrayConcat, arrayGet, arrayLength, arraySum - Reduces firestore-pipelines missing count (86→81) and different shape (4→2)
…g, pow, split, etc.). stubbed
…sType, stringConcat, etc.). Stubbed
…ns, stringReplaceAll, etc.). stubbed
…TimeGranularity. stubbed.
…re:types)
- Add length(fieldName) and length(expression) to pipelines stage API
- Export stage option types from pipelines index (OneOf, *StageOptions, PipelineExecuteOptions)
- Document 47 firestore-pipelines differences in compare-types config (21 extra in RN, 26 different shape)
- Restore DatabaseStageOptions as StageOptions & {} to match SDK
… hardened path to query building
russellwheatley
commented
Mar 20, 2026
russellwheatley
commented
Mar 20, 2026
russellwheatley
commented
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Support for Firestore pipelines API
@react-native-firebase/firestore/pipelinesso consumers can build pipelines withdb.pipeline()and run them withexecute(...).pipelineExecute(...)bridge call at execution time.Public JS & runtime shape
import '@react-native-firebase/firestore/pipelines'installspipeline()onto the Firestore runtime prototype as a side effect. Similar to how it works on firebase-js-sdk.collection,collectionGroup,database,documents, andcreateFrom(query).documents(...)inputsunion(...)self-cycles or cross-instance pipelinespipelineExecute()JS -> native contractpackages/firestore/lib/types/internal.tsis the source of truth for the data sent over the wire to native.pipeline.source: one ofcollection | collectionGroup | database | documents | querypipeline.stages: ordered{ stage, options }[]options: currentlyindexMode?: 'recommended'andrawOptions?: Record<string, unknown>path,queryType,filters,orders,options) rather than as an already-built native query.executionTimeplusresults[], which are rehydrated back intoPipelineSnapshot/PipelineResult.Native architecture by platform
parse -> build native SDK objects -> execute -> serialize snapshotflow.parse -> bridge factory/node builder -> PipelineBridge.execute -> snapshot serializer.Parsing & query building
createFrom(query)can be serialized in JS and rebuilt natively/web later.pipelineSource.createFrom(...).Known limitations & current guards
execute({ indexMode, rawOptions })is rejected in JS on all platforms, because the execute-option surface is not available yet (It just throws an error on all platforms).pipeline.source.rawOptionsfor source builders because the linked iOS pipeline bridge does not currently expose source options.Snapshot & result handling
PipelineSnapshot/PipelineResultobjects.Tests
createFrom(query), documents source, stage execution, expression behavior, unhappy paths, and platform-specific option failures.Why the compare-types script changed
firestore-pipelinesSDK snapshot/config was added so CI can detect drift between RNFB pipeline types and the Firestore JS SDK pipeline types.Related issues
Release Summary
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter