Skip to content
Advertisement

change only one field of entire array of embedded document in mongoose

i have a list schema and a question set schema. the quetsionSet schema is embedded inside the list schema. its working fine but how can i update anything inside the array of embedded document i.e. here i want to change the listname of all the documents inside questionSet (array of questionSet documents).

here is an example of my list document model

JavaScript

Advertisement

Answer

you can use the following in your case

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement