Skip to content

Conversation

@rustagir
Copy link
Contributor

@rustagir rustagir commented Mar 26, 2025

Pull Request Info

PR Reviewing Guidelines

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

Staging Links

linq guide takewhile | skipwhile | table
whats new

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?

@netlify
Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for docs-csharp ready!

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

@rustagir rustagir requested a review from rstam March 26, 2025 14:59
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, one non-blocking suggestion!

.. code-block:: csharp

var query = queryableCollection
.Select(s => s.Grades.TakeWhile(g => g > 90);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the Grades aren't sorted you might be surprised by the results...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! Do you think it would better serve users to show a sort on that array in this example?

:copyable: false

{ "name" : "Maura Day", "grades" : [92, 97] }
{ "name" : "Saul Curzon", "grades" : [100, 95, 91] }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The results do NOT resemble these documents.

The result is an array of Grades. It might better to say the results are:

[92, 97]
[100, 95, 91]

Though I have no idea if the values are correct because I don't know the test data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I am going to test this example now that the driver is released. I must have interpreted the test from the source code incorrectly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed code and results

:copyable: false

{ "name" : "Maura Day", "grades" : [80, 90, 70, 83] }
{ "name" : "Saul Curzon", "grades" : [79, 100, 85, 73] }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The results do NOT resemble these documents.

The result is an array of Grades.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed code and results

@rustagir rustagir requested a review from rstam April 1, 2025 13:52
var query = queryableCollection
.Select(s => s.Grades.TakeWhile(g => g > 90).ToArray());

The results might resemble the following documents:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The results look right, but calling them "documents" is not quite right.

Maybe just say "The results might resemble the following:"

var query = queryableCollection
.Select(s => s.Grades.SkipWhile(g => g < 75).ToArray());

The results might resemble the following documents:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The results look right, but calling them "documents" is not quite right.

Maybe just say "The results might resemble the following:"

@rustagir rustagir force-pushed the DOCSP-48356-skipwhile-takewhile branch from 970d0bd to 867c759 Compare April 3, 2025 13:59
@rustagir rustagir requested a review from rstam April 3, 2025 13:59
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

@rustagir rustagir merged commit c2adeca into mongodb:master Apr 3, 2025
6 checks passed
rustagir added a commit that referenced this pull request Apr 3, 2025
* DOCSP-48356: skipwhile & takewhile

* copyable false

* RStam tech review

* RStam tech review 2

(cherry picked from commit c2adeca)
mongoKart pushed a commit to mongoKart/docs-csharp that referenced this pull request May 16, 2025
* DOCSP-48356: skipwhile & takewhile

* copyable false

* RStam tech review

* RStam tech review 2
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