How can I push to every item of an array of arrays with mongoengine?

Viewed 25

I have the following document on MongoDB: MongoDB example schema

My intention is to push a new exams_eval for every student item into students Array. I don't really know how to do this because is so embedded (course.students[n].exams_eval[new N]). I've tried doing something like this:

            Course.objects(id=course_id).update_one(__raw__={
                '$push': {'students.$.exams_eval': evals}
            })

But it doesn't seems to work. Any idea of how can I effectively solve this issue?

0 Answers
Related