Skip to content

DOCSP-51815 Move and standardize find usage exs #539

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 5 commits into from
Jul 28, 2025

Conversation

lindseymoore
Copy link
Collaborator

@lindseymoore lindseymoore commented Jul 16, 2025

Pull Request Info

PR Reviewing Guidelines

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

Staging Links

https://deploy-preview-539--docs-golang.netlify.app/crud/query/retrieve/

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 16, 2025

Deploy Preview for docs-golang ready!

Name Link
🔨 Latest commit d909132
🔍 Latest deploy log https://app.netlify.com/projects/docs-golang/deploys/68840413256a4c0008c06e9a
😎 Deploy Preview https://deploy-preview-539--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 16, 2025

🔄 Deploy Preview for docs-golang processing

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

Copy link

@mballard-mdb mballard-mdb left a comment

Choose a reason for hiding this comment

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

Great work, just left a few wording suggestions for your consideration!

Copy link

@mballard-mdb mballard-mdb 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 matthewdale and removed request for a team July 22, 2025 21:24
@lindseymoore
Copy link
Collaborator Author

Hi @matthewdale, a question after you review: do you think the bson.D tab needs an example Restaurant data structure, or is it fine as is? Thank you!

@matthewdale
Copy link
Collaborator

@lindseymoore do you mean the Restaurant struct that is used to decode the Find/FindOne results into? If so, then yes, I think we need a copy of the Restaurant struct in each example that uses it. Currently, it's slightly confusing that the Restaurant type isn't defined when you look at just the bson.D tab.

Comment on lines 56 to 58
for _, result := range results {
cursor.Decode(&result)
output, err := json.MarshalIndent(result, "", " ")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this Decode intentional? It seems like it wouldn't do anything since all of the cursor results are already fetched and decoded by calling cursor.All above.

If it's not intentional, the same line needs to be removed from find.go also.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deleted!

@lindseymoore lindseymoore requested a review from matthewdale July 25, 2025 22:29
@lindseymoore
Copy link
Collaborator Author

Due to tech feedback in this PR, we decided to get rid of the bson.D tab.

Copy link
Collaborator

@matthewdale matthewdale 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! 👍

@lindseymoore lindseymoore merged commit eec61b1 into mongodb:comp-cov Jul 28, 2025
5 checks passed
rachel-mack pushed a commit to rachel-mack/docs-golang that referenced this pull request Jul 30, 2025
* DOCSP-51815 Move and standardize find usage exs

* small fixes

* fix

* MB review

* tech feedback
rachel-mack pushed a commit to rachel-mack/docs-golang that referenced this pull request Jul 30, 2025
* DOCSP-51815 Move and standardize find usage exs

* small fixes

* fix

* MB review

* tech feedback
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.

4 participants