Complete the code to import Mongoose in an Express app.
const mongoose = require('[1]');
You need to import mongoose to define schemas and models.
Complete the code to create a new Mongoose schema.
const userSchema = new mongoose.[1]({ name: String, age: Number });The Schema class defines the structure of documents in a collection.
Fix the error in the code to create a model from a schema.
const User = mongoose.model('[1]', userSchema);
The first argument to mongoose.model is the singular model name, capitalized.
Fill both blanks to define a schema with a required string field and create a model.
const productSchema = new mongoose.[1]({ title: { type: String, [2]: true } }); const Product = mongoose.model('Product', productSchema);
Use Schema to define the schema and required: true to make the field mandatory.
Fill all three blanks to define a schema with a default number field, create a model, and export it.
const orderSchema = new mongoose.[1]({ quantity: { type: Number, [2]: 1 } }); const Order = mongoose.model('[3]', orderSchema); module.exports = Order;
Define the schema with Schema, set a default value with default, and name the model 'Order'.
