We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54019d9 commit bc23785Copy full SHA for bc23785
1 file changed
handlers/quiz/models/quizStat.js
@@ -20,12 +20,9 @@ const schema = new Schema({
20
21
schema.index({slug: 1, score: 1}, {unique: true});
22
23
-// TODO: test me
24
-// http://docs.mongodb.org/v2.6/MongoDB-aggregation-guide.pdf
25
schema.statics.getBelowScorePercentage = function*(slug, score) {
26
27
- var belowCount = yield QuizStat.aggregate(
28
- {
+ var belowCount = yield QuizStat.aggregate({
29
$match: {
30
slug: slug,
31
score: {
@@ -64,4 +61,4 @@ schema.statics.getBelowScorePercentage = function*(slug, score) {
64
61
};
65
62
66
63
67
-var QuizStat = module.exports = mongoose.model('QuizStat', schema);
+var QuizStat = module.exports = mongoose.model('QuizStat', schema);
0 commit comments