-
Notifications
You must be signed in to change notification settings - Fork 24
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
[C#] CodeWhisperer Code Comments - Part 4 #154
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.
LGTM with suggestions, but let me know if you want me to take another look!
// Creates a an update document that indicates that the "cuisine" field is | ||
// changing and it's new value will be "Pasta and breadsticks" |
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: based on the Java comments; I think this wording is a little clearer
// Creates a an update document that indicates that the "cuisine" field is | |
// changing and it's new value will be "Pasta and breadsticks" | |
// Creates instructions to update the "cuisine" field of documents that match the filter |
// Finds all the documents that matches the filter and updates the "cuisine" | ||
// value of each by using the update document |
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: also based on the Java sheet
// Finds all the documents that matches the filter and updates the "cuisine" | |
// value of each by using the update document | |
// Updates documents that have a "cuisine" value of "Pizza" |
// Allows automapping of the camelCase database fields to models | ||
var camelCaseConvention = new ConventionPack { new CamelCaseElementNameConvention() }; | ||
ConventionRegistry.Register("CamelCase", camelCaseConvention, type => true); | ||
|
||
// Establish the connection to MongoDB and get the restaurants database | ||
// Establishes the connection to MongoDB and accesses the "sample_restaurants" collection |
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 don't think you need to include comments for these setup classes
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.
Applies to the other setup classes too
// Creates a an update document that indicates that the "cuisine" field is | ||
// changing and it's new value will be "Pasta and breadsticks" | ||
var update = Builders<Restaurant>.Update | ||
.Set(restaurant => restaurant.Cuisine, newValue); | ||
|
||
// Finds all the documents that matches the filter and updates the "cuisine" | ||
// value of each by using the update document |
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: suggestions that I left on UpdateMany.cs also apply here
// Creates a an update document that indicates that the "name" field is | ||
// changing and it's new value will be "2 Bagels 2 Buns" |
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:
// Creates a an update document that indicates that the "name" field is | |
// changing and it's new value will be "2 Bagels 2 Buns" | |
// Creates instructions to update the "name" field of the first document that matches the filter |
// Finds the first document that matches the filter and updates the "name" | ||
// value by using the update document |
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:
// Finds the first document that matches the filter and updates the "name" | |
// value by using the update document | |
// Updates the first document that has a "name" value of "Bagels N Buns" |
// Creates a filter for all documents with a "name" of "Bagels N Buns" | ||
var filter = Builders<Restaurant>.Filter | ||
.Eq(restaurant => restaurant.Name, oldValue); | ||
|
||
// Creates a an update document that indicates that the "name" field is | ||
// changing and it's new value will be "2 Bagels 2 Buns" | ||
var update = Builders<Restaurant>.Update | ||
.Set(restaurant => restaurant.Name, newValue); | ||
|
||
// Finds the first document that matches the filter and updates the "name" | ||
// value by using the update document |
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: same comments in UpdateOne.cs apply here
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-34178
Staging - https://docs-mongodbcom-staging.corp.mongodb.com/csharp/docsworker-xlarge/DOCSP-34178-p4/fundamentals/crud/write-operations/modify/#update-operations
Self-Review Checklist