Skip to content

feat(firestore): arrayFirst and arrayFirstN API features#9019

Open
russellwheatley wants to merge 6 commits into
pipelines-variable-arrayFilterfrom
pipelines-arrayFirst-arrayFirstN
Open

feat(firestore): arrayFirst and arrayFirstN API features#9019
russellwheatley wants to merge 6 commits into
pipelines-variable-arrayFilterfrom
pipelines-arrayFirst-arrayFirstN

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented May 12, 2026

Description

  • Added Firestore Pipeline expression support for arrayFilter, variable, arrayFirst, and arrayFirstN.
  • Implemented native Android and iOS lowering for the new pipeline expression helpers.
  • Added serialization, web, type, consumer type, parity, and e2e coverage for the new APIs.
  • Removed implemented pipeline APIs from the compare-types missing backlog.

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces two new array manipulation operators, arrayFirst and arrayFirstN, to the Firestore pipeline API. These additions allow developers to efficiently select the first element or a specified number of elements from array fields within their queries. The changes include full implementation across the JavaScript/TypeScript SDK, as well as the necessary native lowering logic for Android and iOS, ensuring consistent behavior across all supported platforms.

Highlights

  • New API Features: Added arrayFirst and arrayFirstN operators to the Firestore pipeline API, enabling easier retrieval of the first element or first N elements from array fields.
  • Native Implementation: Implemented native support for these new operators in both Android (Java) and iOS (Swift) to ensure cross-platform parity.
  • Type Safety and Testing: Updated TypeScript definitions, added comprehensive unit tests, and included E2E tests to verify correct serialization and execution of the new operators.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the arrayFirst and arrayFirstN array expression helpers for Firestore pipelines across the TypeScript SDK and native Android/iOS platforms. The changes include adding the necessary logic to the native pipeline builders, updating the TypeScript library with new fluent methods and helper functions, and providing comprehensive unit, type, and E2E tests to ensure cross-platform parity and correct serialization. I have no feedback to provide.

@russellwheatley russellwheatley marked this pull request as ready for review May 12, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant