Answer the question
In order to leave comments, you need to log in
Checking for the completion of one of the fields in the mongo model?
Hai! There is the following model:
const mongoose = require("mongoose");
const UserSchema = new mongoose.Schema({
name: {
type: String,
},
email: {
type: String,
required: true,
unique: true
},
phone: {
type: String,
required: true,
unique: true
},
password: {
type: String,
required: true
},
avatar: {
type: String
},
date: {
type: Date,
default: Date.now
}
});
module.exports = User = mongoose.model("user", UserSchema);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question