-
Notifications
You must be signed in to change notification settings - Fork 243
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
Rachelle De Jesus Pestanas -COMPLETED- #269
base: master
Are you sure you want to change the base?
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.
Comments
- Keep forging ahead, You are making good progress.
- I see you have a good grasp oh MongoDB and Node already.
.get((req, res) => { | ||
Expense | ||
.find({}) | ||
.populate('budget', '_id title budgetAmount' ) |
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.
Solid! I like the well placed use of both populates here for budget and category inside the Expense.
@@ -0,0 +1,19 @@ | |||
const mongoose = require('mongoose'); | |||
const ObjectId = mongoose.Schema.Types.ObjectId; |
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.
Abstracting the ObjectId type like this really comes in handy when using it in reference properties. This method is a great shorthand.
Sprint Challenge Checklist
BUDGET
EXPENSE
.select budget_id and category_id. Add this to schema if not already there.
.populate your budget and category docs
CATEGORY
post a minimum of four categories so when you create your expenses you can assign where they go!
.select the title of the categories