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-34629): C++ SDK: Add sort documentation #3095

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

dacharyc
Copy link
Collaborator

@dacharyc dacharyc commented Nov 29, 2023

Pull Request Info

Jira ticket: https://jira.mongodb.org/browse/DOCSP-34629

Staged changes:

  • CRUD/Read: Add a "Sort Lists and Query Results" section
  • CRUD/Filter Data: Remove the note about not yet supporting sort, and link to the sort example on the Read page

Reminder Checklist

Before merging your PR, make sure to check a few things.

  • Describe your PR's changes in the Release Notes section
  • Create a Jira ticket for corresponding docs-realm docs-app-services, if any

Release Notes

  • C++ SDK
    • CRUD
      • Read: Add a "Sort Lists and Query Results" section with tested, Bluehawked code examples for sorting in C++ SDK.
      • Filter Data: Remove the note about not yet supporting sort, and link to the sort example on the Read page.

Review Guidelines

REVIEWING.md

Copy link

github-actions bot commented Nov 29, 2023

Readability for Commit Hash: 3ef2633

You can see any previous Readability scores (if they exist) by looking
at the comment's history.

Readability scores for changed documents:

  • source/sdk/cpp/crud/filter-data: Grade Level: 8.8, Reading Ease: 57.06
  • source/sdk/cpp/crud/read: Grade Level: 8.8, Reading Ease: 57.06

For Grade Level, aim for 8 or below.

For Reading Ease scores, aim for 60 or above:

Score Difficulty
90-100 Very Easy
80-89 Easy
70-79 Fairly Easy
60-69 Medium
50-59 Fairly Hard
30-49 Hard
0-29 Very Hard

For help improving readability, try Hemingway App.

@dacharyc dacharyc changed the title (C++ SDK): Add sort documentation (DOCSP-34629): C++ SDK: Add sort documentation Nov 29, 2023
Copy link
Collaborator

@cbullinger cbullinger left a comment

Choose a reason for hiding this comment

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

Some non-blocking suggestions

source/sdk/cpp/crud/read.txt Outdated Show resolved Hide resolved
auto specificProject = projects[0];

// :snippet-start: sort-list-by-multiple-properties
auto sortedListProperty = specificProject.items.sort({{"assignee", true}, {"priority", false}});
Copy link
Collaborator

Choose a reason for hiding this comment

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

possible to get this on multiple lines so it's easier to see the multiple sorts? something like:

Suggested change
auto sortedListProperty = specificProject.items.sort({{"assignee", true}, {"priority", false}});
auto sortedListProperty = specificProject.items.sort(
{{"assignee", true},
{"priority", false}}
);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure where exactly to split them and where to put the brackets per C++ convention, so I've configured my VS Code to use the Google linter for C++. It has a default line length of 80 characters, which is the same as our docs line length limit (ostensibly - we don't apply it particularly stringently). But I don't love some of the other formatting changes it made, so I may experiment with linters going forward to find the best one.

It's a good suggestion! We should probably be setting a line length for all of our code examples across all of our SDKs. A lot of mine scroll out of the visible area. I'll add that to our sync doc for discussion.

@dacharyc dacharyc merged commit 3f2e382 into mongodb:master Dec 1, 2023
6 checks passed
@dacharyc dacharyc deleted the DOCSP-34629 branch December 1, 2023 16:27
@docs-builder-bot
Copy link

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