How to $push a nil slice in golang

You can avoid this issue by inserting the line below before calling UpdateOne method:

result.Exams = []Exam{}