Skip to content

Instantly share code, notes, and snippets.

@cmwylie19
Created February 28, 2021 16:30
Show Gist options
  • Save cmwylie19/75668158ae355ed417bff4b46dc36540 to your computer and use it in GitHub Desktop.
Save cmwylie19/75668158ae355ed417bff4b46dc36540 to your computer and use it in GitHub Desktop.
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