Created
January 7, 2019 13:32
-
-
Save pallavtrivedi03/ef02be572b507afdb87d6cd80d6b8e02 to your computer and use it in GitHub Desktop.
MongoDB model for Movie
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 Schema = mongoose.Schema; | |
const movieSchema = new Schema({ | |
title: { | |
type: String, | |
required: true | |
}, | |
year: { | |
type: Number, | |
required: true | |
}, | |
released : { | |
type: String, | |
required: true | |
}, | |
genre : { | |
type: String, | |
required: true | |
}, | |
director : { | |
type: String, | |
required: true | |
}, | |
actors : { | |
type: String, | |
required: true | |
}, | |
plot: { | |
type: String, | |
required: true | |
}, | |
poster : { | |
type: String, | |
required: true | |
}, | |
imdbRating : { | |
type: Number, | |
required: true | |
}, | |
language : { | |
type: String, | |
required: true | |
}, | |
runtime : { | |
type: Number, | |
required: true | |
} | |
}); | |
module.exports = mongoose.model('Movie',movieSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment