Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
In MongoDB, the document data model presents you with the ability to represent hierarchical relationships, to store arrays, and the flexibility to change the structure of documents by adding or deleting fields. Given the following collection of documents structure in the students collection, write the commands to find students named 'John' with 'Maths' as one of the subjects and update his 'total_marks' to '95' considering the document structure
db.students.insert(
{
'_id': ObjectId(),
'name': 'John',
'subjects': ['English', 'Science', 'Maths'],
'total_marks': 85
}
)