{"size": 819, "ext": "js", "max_stars_repo_path": "backend/models/subject.model.js", "max_stars_repo_name": "medmedCH/Quizard", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "backend/models/subject.model.js", "max_issues_repo_name": "medmedCH/Quizard", "max_issues_repo_issues_event_min_datetime": "2021-05-11T22:45:58.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T10:18:57.000Z", "max_forks_repo_path": "backend/models/subject.model.js", "max_forks_repo_name": "medmedCH/Quizard", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 17.8043478261, "max_line_length": 59, "alphanum_fraction": 0.4920634921}
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const subjectmodel = new Schema({
    title: {
        type: String,
        required: true
    },
    description: {
        type: String,
        required: true
    },
    extra: {
        type: String,
    },
    date: {
        type: Date,
        default: Date.now
    },
    views: {
        type: Number,
        default: 0
    },
    Solved: {
        type: Boolean,
        default: false
    },
    rate: {
        type: Number
    },
    Comments: [
        {
            type: mongoose.Schema.Types.ObjectId,
            ref: "Comments"
        }
    ]
    ,
    /*  users: {
          type: mongoose.Schema.Types.ObjectId, ref: 'User'
      },*/

});


const Subject = mongoose.model('subject', subjectmodel);
module.exports = Subject;