mongodb查询错误

时间:2016-11-18 00:18:19

标签: mongodb

我有这个查询

db.grades.aggregate([{$unwind:"$scores"}])

在名为grade的集合中,该集合具有此类型的文档

{ "_id" : ObjectId("50b59cd75bed76f46522c364"), 
"student_id" : 3, 
"class_id" : 12, 
"scores" : [ { "type" : "exam", "score" : 95.99100704101919 }, 
             { "type" : "quiz", "score" : 70.27334558182262 }, 
             { "type" : "homework", "score" : 48.76991564672726 }, 
             { "type" : "homework", "score" : 7.832018287711584 } ] 
 }

当我在结果中运行此查询时,student_id字段在查询的每个结果中都变为零

0 个答案:

没有答案