Skip to content

Instantly share code, notes, and snippets.

@artemis15
Created September 15, 2019 04:31
Show Gist options
  • Save artemis15/940e3a6c28941b00cda80010600c1919 to your computer and use it in GitHub Desktop.
Save artemis15/940e3a6c28941b00cda80010600c1919 to your computer and use it in GitHub Desktop.
USer model fro REST API NODE Project
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let userSchema = new Schema(
{
name : {
type:String,
required:[true,'Name is required']
},
email : {
type:String,
required:[true,'Email is required']
}
},
{
timestamps:true
}
);
module.exports = mongoose.model("user", userSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment