Email field
parent
c98c3d0e44
commit
4cb06a5324
|
@ -9,6 +9,9 @@ const NoteSchema = new Schema({
|
||||||
text: {
|
text: {
|
||||||
type: String, required: [true, "can't be blank"],
|
type: String, required: [true, "can't be blank"],
|
||||||
},
|
},
|
||||||
|
user: {
|
||||||
|
type: Schema.Types.ObjectId, ref: 'User',
|
||||||
|
},
|
||||||
}, { timestamps: true });
|
}, { timestamps: true });
|
||||||
|
|
||||||
module.exports = NoteSchema;
|
module.exports = NoteSchema;
|
||||||
|
|
|
@ -9,8 +9,8 @@ const UserSchema = new Schema({
|
||||||
lastname: {
|
lastname: {
|
||||||
type: String, required: [true, "can't be blank"],
|
type: String, required: [true, "can't be blank"],
|
||||||
},
|
},
|
||||||
username: {
|
email: {
|
||||||
type: String, lowercase: true, unique: true, required: [true, "can't be blank"], match: [/^[a-zA-Z0-9]+$/, 'is invalid'], index: true,
|
type: String, lowercase: true, unique: true, required: [true, "can't be blank"], index: true,
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
type: String, required: [true, "can't be blank"],
|
type: String, required: [true, "can't be blank"],
|
||||||
|
|
Loading…
Reference in New Issue