Skip to content

DOCSP-45007: Distinct #292

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

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Conversation

mcmorisi
Copy link
Collaborator

@mcmorisi mcmorisi commented Nov 14, 2024

Pull Request Info

PR Reviewing Guidelines

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

Staging Links

  • fundamentals/crud/read-operations/distinct
  • fundamentals/crud/read-operations
  • 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?

    Copy link

    netlify bot commented Nov 14, 2024

    Deploy Preview for mongodb-docs-csharp ready!

    Name Link
    🔨 Latest commit 149b490
    🔍 Latest deploy log https://app.netlify.com/sites/mongodb-docs-csharp/deploys/67375d3e2decf2000879002a
    😎 Deploy Preview https://deploy-preview-292--mongodb-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.

    @mcmorisi mcmorisi marked this pull request as ready for review November 14, 2024 21:09
    Copy link
    Collaborator

    @mongoKart mongoKart left a comment

    Choose a reason for hiding this comment

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

    LGTM! One comment but awesome job overall

    @mcmorisi mcmorisi requested review from a team and rstam and removed request for a team November 14, 2024 21:23

    {
    // start-distinct
    var results = collection.Distinct<string>("borough", new BsonDocument()).ToList();
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    It is not clear to the reader what new BsonDocument() is doing here.

    I had to reverse engineer what it was: a filter that matches all documents.

    As alternative to new BsonDocument() might be Builders<Restaurant>.Filters.Empty

    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Might also be worth showing the type safe version:

    collection.Distinct(x => x.Borough, x => true)

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Made tweaks for the next version!

    @mcmorisi mcmorisi requested a review from rstam November 15, 2024 14:45
    Copy link
    Collaborator

    @rstam rstam left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @mcmorisi mcmorisi merged commit 341fcf8 into mongodb:master Nov 19, 2024
    6 checks passed
    @mcmorisi mcmorisi deleted the DOCSP-45007-distinct branch November 19, 2024 13:56
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    mcmorisi added a commit that referenced this pull request Nov 19, 2024
    (cherry picked from commit 341fcf8)
    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