const User = new Schema({
name: {
type: String,
required: true
},
age: {
type: Number,
required: true
},
slug: {
type: String,
required: true
}
})
app.get('/user/:slug', async (req, res) => {
const user = await User.findOne({ slug: req.params.slug }).exec()
res.render('user', {user})
})
/users/5f2450a9c56a065744f8e86b