Mongodb – How to generate an objectId for each element when saving an array in mongoose/node?
I am building an app to make simple surveys, and I am using mongoose. I setup a single entity to define surveys, and this entity includes questions and answers const mongoose = require("mongoose"); const {User} = require("./User"); const SurveySchema =…