Skip to content

Fix syntax in Pipeline examples in TSDoc#9712

Merged
MarkDuckworth merged 3 commits intomainfrom
markduckworth/example-cleanup
Mar 11, 2026
Merged

Fix syntax in Pipeline examples in TSDoc#9712
MarkDuckworth merged 3 commits intomainfrom
markduckworth/example-cleanup

Conversation

@MarkDuckworth
Copy link
Copy Markdown
Contributor

@MarkDuckworth MarkDuckworth commented Mar 10, 2026

Docs only - no changeset

@MarkDuckworth MarkDuckworth requested review from a team as code owners March 10, 2026 20:19
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: e77481c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@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 focuses on enhancing the accuracy and consistency of TSDoc examples across the Firestore SDK, particularly for Pipeline operations and expression usage. By updating outdated syntax, correcting type annotations, and standardizing function calls, the changes aim to provide developers with reliable and runnable code snippets directly within the documentation, thereby improving the clarity and usability of the API.

Highlights

  • TSDoc Example Syntax Correction: Updated TSDoc examples for Pipeline operations to use greaterThan instead of gt and equal instead of eq for improved clarity and correctness.
  • Type Annotation Refinement: Corrected the type annotation for PipelineSnapshot.results from PipelineResults to PipelineResult[] in TSDoc examples.
  • Function Call Standardization: Standardized various function calls in examples, replacing Function.currentTimestamp() with currentTimestamp(), strLength with charLength, toUppercase with toUpper, strReverse with stringReverse, and avg with average.
  • Argument Order and Method Chaining Fixes: Fixed argument order for the add function in addFields examples and adjusted sort examples to use direct method calls like field(...).descending() instead of Ordering.of(...).
  • Consistency in Pipeline Initialization: Ensured consistency in pipeline() calls by adding the firestore. prefix where appropriate in TSDoc examples.

🧠 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.

Changelog
  • packages/firestore/src/api/pipeline_impl.ts
    • Updated where clause examples to use greaterThan instead of gt.
    • Corrected the type of snapshot.results from PipelineResults to PipelineResult[] in examples.
  • packages/firestore/src/lite-api/expressions.ts
    • Modified the equalAny example to pass an array of values.
    • Replaced Function.currentTimestamp() with currentTimestamp() in logicalMaximum and logicalMinimum examples.
    • Removed a duplicate @example tag for isAbsent.
    • Corrected the closing parenthesis for split function examples.
    • Added firestore.pipeline() prefix to a sort example.
    • Updated ifError examples to use field('length') and greaterThan instead of gt.
    • Replaced Field.of('baz') with field('baz') in map and array examples.
    • Changed Constant(9) to constant(9) in a greaterThan example.
    • Replaced strLength with charLength in examples.
    • Replaced toUppercase with toUpper in an example.
    • Replaced strReverse with stringReverse in examples.
    • Corrected the closing parenthesis for split function examples.
  • packages/firestore/src/lite-api/pipeline.ts
    • Updated where clause examples to use equal and greaterThan instead of eq and gt.
    • Corrected add function argument order in addFields examples.
    • Replaced toUppercase() with toUpper() in select and distinct examples.
    • Updated aggregate examples to use average() instead of avg().
    • Revised sort examples to use field(...).descending() and field(...).ascending() directly.
    • Updated rawStage example to use lessThan instead of lt.
Activity
  • No human activity has been recorded for this pull request yet.
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
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 focuses on correcting syntax and updating API usage within the TSDoc examples for the pipeline and expressions features. The changes are well-executed, addressing issues like outdated function names (e.g., gt to greaterThan), fixing syntax errors such as missing parentheses, and generally improving the clarity of the code examples. I've identified a minor issue where a comment has become inaccurate due to the code changes.

Comment thread packages/firestore/src/lite-api/pipeline.ts Outdated
Comment thread packages/firestore/src/lite-api/pipeline.ts Outdated
@MarkDuckworth MarkDuckworth requested a review from a team as a code owner March 10, 2026 21:45
@MarkDuckworth MarkDuckworth merged commit d7b1826 into main Mar 11, 2026
44 checks passed
@MarkDuckworth MarkDuckworth deleted the markduckworth/example-cleanup branch March 11, 2026 16:07
@firebase firebase locked and limited conversation to collaborators Apr 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants