Last active
March 30, 2020 23:59
-
-
Save dalthonmh/2420dcb343f54a9cf1332d12d73e0dd3 to your computer and use it in GitHub Desktop.
Mongo Seeding CLI | examples/import-data-json/models/user.js
This file contains 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 UserShema = mongoose.Schema({ | |
name: String, | |
lastname: String, | |
username: { | |
type: String, | |
unique: true | |
}, | |
password: String, | |
role: { | |
type: String, | |
enum: ["mozo", "despachador", "admin"], | |
default: "mozo" | |
} | |
}); | |
module.exports = mongoose.model("User", UserShema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mongo Seeding CLI | models/user.js