-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adding Update code #2
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.
One minor comment about type choices.
updateOperation = push("comments", "You will learn a lot if you read the MongoDB blog!"); | ||
UpdateOptions options = new UpdateOptions().upsert(true); | ||
updateResult = gradesCollection.updateOne(filter, updateOperation, options); | ||
System.out.println("\n=> Upsert document with {\"student_id\":10002.0, \"class_id\": 10.0} because it doesn't exist yet."); |
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.
Why doubles not ints?
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.
Maybe I should use doubles everywhere then to avoid the distraction with the type equivalence when doing the queries?
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'm happy either way - just wanted to flag it.
updateOperation = push("comments", "You will learn a lot if you read the MongoDB blog!"); | ||
UpdateOptions options = new UpdateOptions().upsert(true); | ||
updateResult = gradesCollection.updateOne(filter, updateOperation, options); | ||
System.out.println("\n=> Upsert document with {\"student_id\":10002.0, \"class_id\": 10.0} because it doesn't exist yet."); |
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'm happy either way - just wanted to flag it.
No description provided.