1
私は以下のようにMongoDBに格納された各教師のための各試験の各質問に対する回答を提示する階層データ構造があります:あなたが使用することはできません、私はあなたのコメントに感謝
db.foo.insert({name:"teacher1"}); //Done
db.foo.update({name:"teacher1"},{$push:{"exams":{name:"exam1"}}}); //Done
db.foo.update({"exams.name":"exam1"},{$push:{"exams.$.questions":{name:"question1"}}}); //Done
db.foo.update({"exams.questions.name":"question1"},
{$push:{"exams.$.questions.$.answers":{name:"answer1"}}});
// Error => can't append to array using string field name [$]
を