I'd like to know how to add or update one embedded document in mongodb? Thus how to add one answer item and how to update one answer item below? I'd also like to know how to do it using mongoose.
questions: [{
"questionID": 1,
"questionTitle": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur sed tortor. Integer",
"questionText": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur sed tortor. Integer aliquam adipiscing lacus. Ut nec urna et arcu imperdiet ullamcorper. Duis at lacus. Quisque purus sapien,",
"name": "Gabriel",
"firebaseuser": "Nunc",
"category": "Programming",
"votesup": 516,
"votesdown": 14,
"beginningdate": "28/07/2020",
"modifieddate": "24/08/2020",
"enddate": "null",
"questionclosed": false,
"closereason": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur",
"close_user": "sulkija",
"answers": [{
answerid:1,
answertext: "1 XXXXXXXXXXXXXXXX CCCCCCCCCCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDDDDDDDDDDD ",
answerer: "mika",
firebaseanswerer: "hjjjjjjjjjjjjjjfas",
answervotesup: 7,
answervotesdown: 0,
answerdate: "24/08/2020",
answermodified: ""
},
{
answerid:2,
answertext: "Esimerkkivastaus 2 XXXXXXXXXXXXXXXX CCCCCCCCCCCCCCCCCCCCCCCC DDDDDDDDDDDDDDDDDDDDDDDDDD HHHHHHHHHHHHHHHHHHHHHHHHH",
answerer: "mika",
firebaseanswerer: "hjjjjjjjjjjjjjjfas",
answervotesup: 7,
answervotesdown: 0,
answerdate: "30/08/2020",
answermodified: ""
}]
},
}]