Created
April 29, 2019 13:25
-
-
Save beaucarnes/3e7733973c371ceea00882a0d1365494 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 userSchema = new Schema({ | |
| username: { | |
| type: String, | |
| required: true, | |
| unique: true, | |
| trim: true, | |
| minlength: 3 | |
| }, | |
| }, { | |
| timestamps: true, | |
| }); | |
| const User = mongoose.model('User', userSchema); | |
| module.exports = User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi beau,
I was going through your MERN stack course on freeCodeCamp and I am suddenly confused on this naming convention , e.g user.model.js ??
is this same as user.js?
I cant seem to find the answer on web.