-
Notifications
You must be signed in to change notification settings - Fork 6
Yaroslav kazeev w4 databases #25
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
base: main
Are you sure you want to change the base?
Yaroslav kazeev w4 databases #25
Conversation
yunchen4
left a comment
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.
Hi Yaroslav,
The assignment looks good to me! Only a small point that needs rework.
Please let me know once you finish rework. Thanks!
| await account.updateOne( | ||
| { account_number: receiver_account_number }, | ||
| { $inc: { balance: amount } }, | ||
| { | ||
| $push: { account_changes: { amount: amount, changed_date, remark } }, | ||
| }, | ||
| { session } | ||
| ); |
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.
Needs rework: the position of $push is wrong for the second updateOne.
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.
done
| } catch (error) { | ||
| console.log("Transaction aborted.", error); |
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.
suggestion: It's ok in the assignment to use simple error handling (just logging). In real working situation, usually the error will be thrown or return some thing that clearly differentiates the normal state without error.
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.
done
|
Thanks for your suggestions, Chen |
yunchen4
left a comment
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!
No description provided.