Skip to main content
4 of 4
Incorporated comment
Paul White
  • 90.3k
  • 30
  • 424
  • 663

Try this. It may need small modifications based on your other variables but I think this will work:

db.students.update(
   { first_name: 'AA' },
   { $set:
      {
        "cours_reussis.0.name_school": 'ENSA'
      }
   }
)

cours_reussis is an array. The 0 is the array index.

For your reference: $set