I have a meeting list. I have a list of participants. Wanting to know which participant is assigned to the meeting, I had the id of the participants. However, I need to add information whether the participant confirmed his presence and whether he came to the meeting. I don't know whether to add data to "friends". enter image description here enter image description here
enter image description here I tried to do as in the picture. However, I don't know how to add default values later.
CodePudding user response:
To add new data to subdocument you have to use mongodb $push method https://www.mongodb.com/docs/manual/reference/operator/update/push/
As I understand you want exactly to do that.