Course

Creating Models and Actions: Exercise

In the previous lesson, we learned how to create a basic model and how to create a server action to use it. In this exercise- take a moment to practice this skill.

This isn't a project- it's just a simple exercise to help you get more comfortable with creating models and actions. So feel free to experiment and try new things.

Instructions

  1. Expand on the model. Add new fields to the model.
  2. Create another model in the folder. Call it .
  3. Add fields to the model.
  4. Create a new action file in the folder. Call it and write a create and read actions for the model.
  5. Test your actions using the browser!

Tips

Hint
monkey
  • Remember to import the model in the action file.
  • Use the and methods from the model to interact with the database.

0 Comments

"Please login to view comments"

glass-bbok

Join the Conversation!

Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.

Upgrade your account
tick-guideNext Lesson

Creating Documents in Mongoose