<form class="signup-form" action="" method="POST">
<form class="signup-form" action="/signup" method="POST">
app.use(express.urlencoded({extended: false}))
console.log(req.query)
в GET, то показывает{ ref: '5fa277b302227a1c04ea9612' }
, {}
const {model, Schema} = require('mongoose')
const userSchema = new Schema({
login: {
type: String,
required: true
},
email: {
type: String,
required: true
},
password: {
type: String,
required: true
},
referrals: [{
type: Schema.Types.ObjectId,
ref: 'User',
autopopulate: true
}]
})
userSchema.plugin(require('mongoose-autopopulate'));
module.exports = model('User', userSchema)