Skip to content

DOCSP-49230 - Aggregation stages (builders) #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: docsp-45382-comp-cvg
Choose a base branch
from

Conversation

mongoKart
Copy link
Collaborator

@mongoKart mongoKart commented Apr 15, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-49230

Staging Links

  • aggregation/stages
  • aggregation
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    Copy link

    netlify bot commented Apr 15, 2025

    Deploy Preview for docs-csharp ready!

    Name Link
    🔨 Latest commit 900c152
    🔍 Latest deploy log https://app.netlify.com/sites/docs-csharp/deploys/67fe9e045479fb0008f1377c
    😎 Deploy Preview https://deploy-preview-591--docs-csharp.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    * - :manual:`$bucket </reference/operator/aggregation/bucket/>`
    - Categorizes incoming documents into groups, called buckets,
    based on a specified expression and bucket boundaries.
    - :ref:`Bucket() <csharp-aggregation-bucket>`
    Copy link
    Collaborator Author

    @mongoKart mongoKart Apr 15, 2025

    Choose a reason for hiding this comment

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

    All method links are broken pending future PRs

    - Builders Method

    * - :manual:`$bucket </reference/operator/aggregation/bucket/>`
    - Categorizes incoming documents into groups, called buckets,
    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Stage descriptions were taken (almost) verbatim from server docs

    @rustagir rustagir self-requested a review April 15, 2025 15:38
    Copy link
    Collaborator

    @rustagir rustagir left a comment

    Choose a reason for hiding this comment

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

    good work!

    :titlesonly:
    :maxdepth: 1

    Stages </aggregation/stages>
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: consider titling this Pipeline Stages

    .. _csharp-aggregation-stages:

    ==================
    Aggregation Stages
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: consider calling this pipeline stages or aggregation pipeline stages

    Comment on lines 23 to 24
    On this page, you can learn how to create an aggregation pipeline and add stages to it
    by using methods in the {+driver-short+}.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: since this guide is more about creating the stages than adding them to a pipeline

    Suggested change
    On this page, you can learn how to create an aggregation pipeline and add stages to it
    by using methods in the {+driver-short+}.
    On this page, you can learn how to create an aggregation pipeline and pipeline stages
    by using methods in the {+driver-short+}.

    in the aggregation pipeline, but doesn't provide type hints or type safety.

    The following code example shows how to add ``$unset``, an aggregation
    stage without a corresponding method, to an empty aggregation pipeline:
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggested change
    stage without a corresponding method, to an empty aggregation pipeline:
    stage without a corresponding builder method, to an empty aggregation pipeline:

    Aggregation Stage Methods
    -------------------------

    The following table lists the builders methods in the {+driver-short+} that correspond
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggested change
    The following table lists the builders methods in the {+driver-short+} that correspond
    The following table lists the builder methods in the {+driver-short+} that correspond

    Comment on lines 106 to 110
    to stages in the aggregation pipeline. For more information about an aggregation stage,
    click the stage name. For more information about a builders method, click the
    method name. If an aggregation stage isn't in the table, you must use the
    :ref:`BsonDocument <csharp-aggregation-stages-bsondocument>` syntax to add the stage
    to your pipeline.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggested change
    to stages in the aggregation pipeline. For more information about an aggregation stage,
    click the stage name. For more information about a builders method, click the
    method name. If an aggregation stage isn't in the table, you must use the
    :ref:`BsonDocument <csharp-aggregation-stages-bsondocument>` syntax to add the stage
    to your pipeline.
    to stages in the aggregation pipeline. To learn more about an aggregation stage,
    follow the link from the stage name to the Server manual reference. To learn more about a
    builder method, follow the link from the method name to the dedicated guide. If an
    aggregation stage isn't in the table, the driver does not provide a builder method, so you must use the
    :ref:`BsonDocument <csharp-aggregation-stages-bsondocument>` syntax to add the stage
    to your pipeline.

    Comment on lines 169 to 171
    - Performs a recursive search on a collection. To each output
    document, adds a new array field that contains the traversal
    results of the recursive search for that document.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggested change
    - Performs a recursive search on a collection. To each output
    document, adds a new array field that contains the traversal
    results of the recursive search for that document.
    - Performs a recursive search on a collection. This method adds
    a new array field to each output document that contains the traversal
    results of the recursive search for that document.

    -----------------

    To learn more about assembling an aggregation pipeline, see
    :manual:`Aggregation Pipeline </core/aggregation-pipeline/>`.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: add link target

    Suggested change
    :manual:`Aggregation Pipeline </core/aggregation-pipeline/>`.
    :manual:`Aggregation Pipeline </core/aggregation-pipeline/>` in the Server manual.

    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    applies everywhere

    @mongoKart mongoKart requested a review from rustagir April 15, 2025 17:12
    Copy link
    Collaborator

    @rustagir rustagir left a comment

    Choose a reason for hiding this comment

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

    dont need to take another look unless you request. Nice job!

    Comment on lines 88 to 89
    The following code example shows how to add ``$unset``, an aggregation
    stage without a corresponding builder method, to an empty aggregation pipeline:
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S; wording still awkward, maybe try this wording as its actually not super important to know that the stage doesnt have a builder method (since you can do this with any stage)

    Suggested change
    The following code example shows how to add ``$unset``, an aggregation
    stage without a corresponding builder method, to an empty aggregation pipeline:
    The following code example shows how to add an ``$unset`` stage to an empty aggregation pipeline:

    .. code-block:: csharp

    var pipeline = new EmptyPipelineDefinition<BsonDocument>()
    .AppendStage<BsonDocument, BsonDocument, BsonDocument>("{ $unset: "field1" }");
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: text highlighting weird, do you need to escape the characters as there's multiple sets of " marks?

    Comment on lines 334 to 336
    available for self-managed deployments. To learn more, see
    :atlas:`Atlas Search Aggregation Pipeline Stages
    </reference/atlas-search/query-syntax>` in the Atlas documentation.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    S: change the link to go to the atlas vector search overview

    @mongoKart mongoKart requested review from a team and JamesKovacs and removed request for a team April 15, 2025 17:57
    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.

    2 participants