Skip to content

DOCSP-51823 Standardize Distinct usage example #543

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 5 commits into
base: comp-cov
Choose a base branch
from

Conversation

lindseymoore
Copy link
Collaborator

@lindseymoore lindseymoore commented Jul 21, 2025

Pull Request Info

PR Reviewing Guidelines

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

Staging Links

https://deploy-preview-543--docs-golang.netlify.app/crud/query/distinct/#retrieve-distinct-values-example--full-file

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 Jul 21, 2025

Deploy Preview for docs-golang ready!

Name Link
🔨 Latest commit b5f5aaf
🔍 Latest deploy log https://app.netlify.com/projects/docs-golang/deploys/6883fe2cf7cd6600081732fe
😎 Deploy Preview https://deploy-preview-543--docs-golang.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 project configuration.

@docs-builder-bot
Copy link

docs-builder-bot commented Jul 21, 2025

🔄 Deploy Preview for docs-golang processing

Item Details
🔨 Latest Commit 729a723cf0234dc7bcd8b2a1325e713419e08b7d
😎 Deploy Preview https://deploy-preview-543--docs-golang.netlify.app
🔍 Build Logs View Logs

Copy link
Collaborator

@norareidy norareidy left a comment

Choose a reason for hiding this comment

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

Looks good! I left a few suggestions

Comment on lines 137 to 139
The following code uses a struct to retrieve distinct values of the
``borough`` field for documents in the ``restaurants`` collection that match
the specified filter:
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 you already described the code example above, I think you can simplify this description to something like:

Suggested change
The following code uses a struct to retrieve distinct values of the
``borough`` field for documents in the ``restaurants`` collection that match
the specified filter:
The following code uses a struct to retrieve distinct ``borough`` field values of the matching documents:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Applies to the bson.D tab as well

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'm actually fine with restating the purpose of the code example in a bit more detail here. Mostly because people skim, and it might be helpful for bots to have the description right above the code example.

Comment on lines +69 to +71
// Brooklyn
// Manhattan
// Queens
Copy link
Collaborator

Choose a reason for hiding this comment

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

S: up to you, but since you show the sample output I don't think you need this section in the code file

Copy link
Collaborator Author

@lindseymoore lindseymoore Jul 23, 2025

Choose a reason for hiding this comment

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

Talked with Stephanie, and we agreed it was best to keep them in! In the case where users copy the code out of their own terminal, they can have the output easily accessible.

@lindseymoore lindseymoore requested a review from norareidy July 23, 2025 18:47
Copy link
Collaborator

@norareidy norareidy left a comment

Choose a reason for hiding this comment

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

lgtm!

@lindseymoore lindseymoore requested review from a team and qingyang-hu and removed request for a team July 25, 2025 22:02
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