Skip to main content
Incorporated comment
Source Link
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

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'
      }
   }
)

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

code block
Source Link
Michael Green
  • 25.1k
  • 13
  • 53
  • 98

Try this.May 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' } } )

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

Try this.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' } } )

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'
      }
   }
)
Reference variable change.
Source Link

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

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

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

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

Try this.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' } } )

Source Link
Loading