Files
headup_api/models/mongo/QcmChoice.js
T
2024-05-08 20:37:33 +02:00

17 lines
399 B
JavaScript

var mongoose = require('mongoose');
var QcmChoiceSchema = new mongoose.Schema({
index: String,
libelle: String,
correct: Boolean
}, {timestamps: true, toJSON: {virtuals: true}});
QcmChoiceSchema.methods.toJSONFor = function() {
return {
index: this.index,
libelle: this.libelle,
correct: this.correct
};
};
mongoose.model('QcmChoice', QcmChoiceSchema);