试图找出我收到此错误的原因,我的代码在
之下db.assign1.aggregate([
{$unwind: "$courses"},
{$match: {status: "active"}},
{$group: {_id: {"Course Code": "$courses.code"},
"Total Questions": {$sum: "$courses.total_questions"},
"Correct Answers": {$sum: "$courses.correct_answers"}}},
{$project: {_id: 0,
"Course Code": 1,
"Total Questions:": 1,
"Correct Answers": 1,
"% Correct": {$divide: [{$sum: "$courses.correct_answers"},{$sum: "$courses.correct_answers"}]}}}