Skip to content
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

DOCSP-46188 Add Lookup() method to LINQ docs #522

Merged
merged 3 commits into from
Mar 18, 2025

Conversation

jordan-smith721
Copy link
Collaborator

@jordan-smith721 jordan-smith721 commented Mar 13, 2025

Pull Request Info

PR Reviewing Guidelines

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

Staging Links

  • fundamentals/linq
  • 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 Mar 13, 2025

    Deploy Preview for docs-csharp ready!

    Name Link
    🔨 Latest commit 0c3520f
    🔍 Latest deploy log https://app.netlify.com/sites/docs-csharp/deploys/67d446cd446cbc0008e7e7ff
    😎 Deploy Preview https://deploy-preview-522--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.

    Copy link
    Collaborator

    @shuangela shuangela left a comment

    Choose a reason for hiding this comment

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

    lgtm, a few questions and nits


    .. code-block:: csharp

    var lookupResult = _restaurantsCollection.AsQueryable()
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Q: Why does this code sample use _restaurantsCollection and _reviewCollection as the name of the collections while the previous one uses the name without _? Is there a specific reason?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Good catch, that was just how I had my variables for testing and I forgot to remove the _ in this case

    GroupJoin()
    +++++++++++

    You can perform a ``$lookup`` stage by using the LINQ ``GroupJoin()`` method. To
    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
    You can perform a ``$lookup`` stage by using the LINQ ``GroupJoin()`` method. To
    You can specify a ``$lookup`` stage by using the LINQ ``GroupJoin()`` method. To

    restaurant => restaurant.Name,
    review => review.RestaurantName);

    The preceding example returns a list of ``LookupResult`` objects that
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Q: Do we want to add a output here?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

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

    Outputting the result here just returns an object that I couldn't iterate through without making the code a fair bit more complex, so I opted to just clarify that it returns the LookupResult object. Not ideal but the only other way I could think of showing it was with debugger output but that wouldn't go with our normal style/the flow of the page.

    Copy link
    Member

    @sanych-sun sanych-sun left a comment

    Choose a reason for hiding this comment

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

    LGTM

    @jordan-smith721 jordan-smith721 merged commit b69bfd8 into mongodb:master Mar 18, 2025
    5 of 6 checks passed
    @jordan-smith721 jordan-smith721 deleted the DOCSP-46188-lookup branch March 18, 2025 14:26
    jordan-smith721 added a commit that referenced this pull request Mar 18, 2025
    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