Created
June 12, 2019 17:58
-
-
Save daniloab/399c89b56a25a1ca2be576337be71b72 to your computer and use it in GitHub Desktop.
Simple example player model
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 playerSchema = new Schema({ | |
status: { | |
type: Number | |
}, | |
name: { | |
type: String, | |
required: 'name is required', | |
}, | |
lastname: { | |
type: String, | |
required: 'lastname is required', | |
}, | |
position: { | |
type: String, | |
}, | |
taxId: { | |
type: String, | |
required: 'taxId is required' | |
}, | |
team: { | |
type: ObjectId, | |
ref: 'Team' | |
} | |
}, { timestamps: true }); | |
export default mongoose.model('Player', playerSchema) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment