Created
February 28, 2021 16:30
-
-
Save cmwylie19/75668158ae355ed417bff4b46dc36540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require("mongoose"); | |
const Schema = mongoose.Schema; | |
const User = new Schema({ | |
name: String, | |
password: String, | |
tasks: { type: Array, default: [] }, | |
lists: { type: Array, default: [] }, | |
friends: { type: Array, default: [] }, | |
password: { type: String, required: true }, | |
friendRequests: { type: Array, default: [] }, | |
email: { | |
type: String, | |
unique: true, // `email` must be unique | |
}, | |
created: { type: Date, default: Date.now }, | |
}); | |
module.exports = mongoose.model("User", User); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment