-
Notifications
You must be signed in to change notification settings - Fork 33
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 30927 work with bson options #278
Docsp 30927 work with bson options #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! A few small changes
source/fundamentals/bson.txt
Outdated
the driver marshals and unmarshals BSON on any level, from | ||
``collection`` to ``Client``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue: I'm not sure what "any level" refers to. How many are there?
Suggestion: Can we be more specific about these levels?
source/fundamentals/bson.txt
Outdated
The following example demonstrates how the ``BSONOptions`` is set using | ||
the ``Movies`` collection as an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: Two points from the Style Guide here: Avoid passive voice and Don't use "using" alone
S:
The following example demonstrates how the ``BSONOptions`` is set using | |
the ``Movies`` collection as an example. | |
The following example demonstrates how to set ``BSONOptions`` for | |
the ``Movies`` collection: |
source/fundamentals/bson.txt
Outdated
The following example demonstrates how the ``BSONOptions`` is set using | ||
the ``Movies`` collection as an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: In our other docs, we keep collection names lowercase (e.g. here)
S:
The following example demonstrates how the ``BSONOptions`` is set using | |
the ``Movies`` collection as an example. | |
The following example demonstrates how the ``BSONOptions`` is set using | |
the ``movies`` collection as an example. |
source/fundamentals/bson.txt
Outdated
To learn more about the options and usage of ``BSONOptions``, visit the `API Documentation | ||
<https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo#example-Connect-BSONOptions>`_ | ||
for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: This sentence can probably be shorter and a little clearer
S:
To learn more about the options and usage of ``BSONOptions``, visit the `API Documentation | |
<https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo#example-Connect-BSONOptions>`_ | |
for more information. | |
To learn more about ``BSONOptions``, see the `API Documentation | |
<https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo#example-Connect-BSONOptions>`__. |
source/fundamentals/bson.txt
Outdated
coll := client.Database("sample_mflix").Collection("movies", | ||
bsonOpts) | ||
|
||
To learn more about the options and usage of ``BSONOptions``, visit the `API Documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: Put this sentence in a Tip box, since it's more supplementary than a natural conclusion to this section
source/fundamentals/bson.txt
Outdated
coll := client.Database("sample_mflix").Collection("movies", | ||
bsonOpts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: I think these lines should be dedented back to the beginning...
coll := client.Database("sample_mflix").Collection("movies", | |
bsonOpts) | |
coll := client.Database("sample_mflix").Collection("movies", | |
bsonOpts) |
source/fundamentals/bson.txt
Outdated
bsonOpts) | ||
|
||
To learn more about the options and usage of ``BSONOptions``, visit the `API Documentation | ||
<https://pkg.go.dev/go.mongodb.org/mongo-driver/mongo#example-Connect-BSONOptions>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: We almost always use source constants (in snooty.toml) to represent API links, making it easier and less error-prone. I would try using a source constant here.
source/fundamentals/bson.txt
Outdated
bsonOpts := &options.BSONOptions{ | ||
UseJSONStructTags: true, | ||
} | ||
coll := client.Database("sample_mflix").Collection("movies", | ||
bsonOpts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: I'm not a Go expert, but structuring the code like the following seems more readable:
bsonOpts := &options.BSONOptions{ | |
UseJSONStructTags: true, | |
} | |
coll := client.Database("sample_mflix").Collection("movies", | |
bsonOpts) | |
bsonOpts := &options.BSONOptions { | |
UseJSONStructTags: true | |
} | |
coll := client.Database("sample_mflix") | |
.Collection("movies", bsonOpts) |
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with everything, but comma on line 227 is needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + 1 suggestion. Great job addressing the feedback!
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-30927
Staging
Self-Review Checklist