Saving form data
Now we're collecting form data on our server, the final step is to save it in our database.
When our form is submitted, we need to use Mongoose to create a new document, filled with data from the form, and save it to the right collection in the database.
Whenever we're interacting with the database, we need to include the right model.
Let's say we handle form submissions
Part of Databases
- Introducing databases
- Organising a databaseP
- Using a database driverP
- Creating modelsP
- Making forms workP
- Collecting form dataP
- Saving form dataP