What values will be extracted from this URL: /api/products/4…
What values will be extracted from this URL: /api/products/42?category=electronics&sort=price app.get(‘/api/products/:id’, (req, res) => { const productId = req.params.id; const category = req.query.category; const sort = req.query.sort; res.json({ productId, category, sort });});
Read DetailsGiven the following Mongoose schema: const studentSchema = n…
Given the following Mongoose schema: const studentSchema = new mongoose.Schema({ name: { type: String, required: true, minLength: 2, maxLength: 50 }, email: { type: String, required: true, match: /^[^\s@]+@stthomas\.edu$/ }, gpa: { type: Number, min: 0.0, max: 4.0 }, major: { type: String, enum: [“Computer Science”, “Mathematics”, “Engineering”] }});Which of the following documents will FAIL validation?
Read Details