Skip to content

feat(firestore): add string pipeline expressions#9479

Open
dlarocque wants to merge 12 commits intomainfrom
dl/string-expressions
Open

feat(firestore): add string pipeline expressions#9479
dlarocque wants to merge 12 commits intomainfrom
dl/string-expressions

Conversation

@dlarocque
Copy link
Contributor

@dlarocque dlarocque commented Jan 30, 2026

Adds support for stringRepeat, stringReplaceOne, stringReplaceAll, and stringIndexOf, ltrim, rtrim Pipeline expressions.

Adds support for `stringRepeat`, `stringReplaceOne`, `stringReplaceAll`, and `stringIndexOf` Pipeline expressions.
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: 8f5137f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
firebase Minor
@firebase/firestore Minor
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dlarocque, 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 significantly enhances Firestore's data manipulation capabilities by introducing a suite of new string pipeline expressions. These additions provide developers with more granular control over string data within their queries, enabling operations like repeating strings, replacing substrings (both first and all occurrences), and finding the index of a substring. This expansion of the pipeline API allows for more complex data transformations to be performed efficiently on the server side.

Highlights

  • New String Pipeline Expressions: Introduced four new string manipulation functions: stringRepeat, stringReplaceOne, stringReplaceAll, and stringIndexOf.
  • API Surface Expansion: The new string functions are added to both the full Firestore and Firestore Lite API surfaces, allowing for more powerful data transformations directly within queries.
  • Comprehensive Documentation: Detailed documentation, including signatures, parameters, return types, and examples, has been added for each new string expression in both the main pipelines and expression-specific documentation.
  • Integration Tests: New integration tests have been added for all four string pipeline expressions to ensure their correct functionality in both full and lite Firestore environments.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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
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 adds support for stringRepeat, stringReplaceOne, stringReplaceAll, and stringIndexOf Pipeline expressions to Firestore. The implementation, API definitions, and tests are well-structured. I've identified a few issues in the documentation, including duplicate anchor IDs and broken links, which could affect usability. I've also suggested some minor code reordering to improve maintainability.

@dlarocque
Copy link
Contributor Author

/gemini review

Copy link
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 introduces several useful string manipulation expressions for Firestore pipelines: stringRepeat, stringReplaceOne, stringReplaceAll, stringIndexOf, ltrim, and rtrim. The implementation is well-structured and includes comprehensive tests for both the lite and full SDKs. My feedback primarily focuses on improving the documentation and JSDoc for the new ltrim and rtrim functions to ensure consistency and provide clearer examples for developers.

@dlarocque
Copy link
Contributor Author

/gemini review

Copy link
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 introduces several new string manipulation functions for Firestore pipelines, including stringRepeat, stringReplaceOne, stringReplaceAll, stringIndexOf, ltrim, and rtrim. The implementation appears solid, with corresponding updates to API definitions, documentation, and test suites. The changes are well-structured and the new features are a valuable addition. I've identified a couple of minor formatting issues in the documentation that could be cleaned up.

@dlarocque dlarocque marked this pull request as ready for review February 3, 2026 21:03
@dlarocque dlarocque requested review from a team as code owners February 3, 2026 21:03
@dlarocque
Copy link
Contributor Author

@milaGGL I updated all the tests to match the Node tests

@dlarocque dlarocque requested a review from milaGGL February 11, 2026 17:00
@dlarocque dlarocque assigned milaGGL and unassigned MarkDuckworth Feb 11, 2026
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.

3 participants