如何获得包含课堂信息和学生信息的单个结果集?这可能吗?Student
description
name
Classroom
Student
在我当前的示例中,与 1 对 N 的关系
Classrooms.first
目前返回
Classroom {
:_id => "5222da075d39f3e4e802000a",
:description => "Learn english",
:student_id => "50f9d5bc5d39f30ebb010004"
}
Classroom.first.student.first
目前只返回:
Student {
:_id => "50f9d5bc5d39f30ebb010004",
:name => "Michael",
:classroom_id => "5222da075d39f3e4e802000a"
}