Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@devindianushika
Last active May 21, 2020 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devindianushika/dd1f417e4a3fb1577f85c0cffbf1040d to your computer and use it in GitHub Desktop.
Save devindianushika/dd1f417e4a3fb1577f85c0cffbf1040d to your computer and use it in GitHub Desktop.
Mongoose schema file
const mongoose = require('mongoose');
const schema = mongoose.Schema
const userSchema = new schema({
name: { type: String, required: true },
email: { type: String, required: true },
});
const User = module.exports = mongoose.model('User', userSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment