Skip to main content
Tweeted twitter.com/StackDBAs/status/1140635466330451970
Improve formatting
Source Link
Stennie
  • 10.3k
  • 2
  • 29
  • 46

how to insert How can I update a new informationsingle field in vector ( mongodb )an array of embedded documents?

db.students.insert({first_name:'AA',last_name:'BB',cours_reussis:[{intitule:'PAI',note:0,name_school:'EPFC']}) I would like to update a field only. name_school : "ENSA" instead of " EPFC" thank you soo much I would like to update a field in an array of embedded documents.

My sample document is:

db.students.insert(
    {
        first_name:'AA',
        last_name:'BB',
        cours_reussis:[{intitule:'PAI',note:0,name_school:'EPFC'}]
    }
)

I'd like to change the value of name_school to "ENSA" instead of "EPFC".

how to insert a new information in vector ( mongodb )

db.students.insert({first_name:'AA',last_name:'BB',cours_reussis:[{intitule:'PAI',note:0,name_school:'EPFC']}) I would like to update a field only. name_school : "ENSA" instead of " EPFC" thank you soo much

How can I update a single field in an array of embedded documents?

I would like to update a field in an array of embedded documents.

My sample document is:

db.students.insert(
    {
        first_name:'AA',
        last_name:'BB',
        cours_reussis:[{intitule:'PAI',note:0,name_school:'EPFC'}]
    }
)

I'd like to change the value of name_school to "ENSA" instead of "EPFC".

Source Link
zouhair
  • 113
  • 1
  • 2
  • 7

how to insert a new information in vector ( mongodb )

db.students.insert({first_name:'AA',last_name:'BB',cours_reussis:[{intitule:'PAI',note:0,name_school:'EPFC']}) I would like to update a field only. name_school : "ENSA" instead of " EPFC" thank you soo much