Skip to content

Instantly share code, notes, and snippets.

@daniloab
Created June 12, 2019 17:58
Show Gist options
  • Save daniloab/399c89b56a25a1ca2be576337be71b72 to your computer and use it in GitHub Desktop.
Save daniloab/399c89b56a25a1ca2be576337be71b72 to your computer and use it in GitHub Desktop.
Simple example player model
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