Skip to content

Commit

Permalink
module export user
Browse files Browse the repository at this point in the history
  • Loading branch information
georgina puig committed Jul 17, 2020
1 parent efc6496 commit 8b4a7a6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions models/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const mongoose = require('mongoose');

// USER - email, name
const userSchema = new mongoose.Schema({
email: String,
name: String,
posts: [
{
type: mongoose.Schema.Types.ObjectId,
ref: 'Post'
}
]
});
const User = mongoose.model("User", userSchema);

module.exports = User;

0 comments on commit 8b4a7a6

Please sign in to comment.