{"size": 644, "ext": "js", "max_stars_repo_path": "models/movie.js", "max_stars_repo_name": "thortek/4790-react-node-app", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "models/movie.js", "max_issues_repo_name": "thortek/4790-react-node-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "models/movie.js", "max_forks_repo_name": "thortek/4790-react-node-app", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.4054054054, "max_line_length": 57, "alphanum_fraction": 0.4704968944}
import mongoose from 'mongoose'

const Schema = mongoose.Schema

const movieSchema = new Schema({
    title: {
        type: String,
        required: true
    },
    rank: {
        type: Number,
        required: false
    },
    image: {
        type: Object,
        required: false,
        height: {
            type: Number
        },
        imageUrl: {
            type: String
        },
        width: {
            type: Number
        }
    },
    id: {
        type: String,
        required: true
    },
    year: {
        type: String,
        required: false
    }
})

export const Movie = mongoose.model('Movie', movieSchema)