After traversing an array, I create a new mongoose schema by adding two fields and then saving it.
myArray.forEach(email => {
const newUsers = new UserList({
email,
uuid: uuidv4()
});
newUsers.save().catch(err => console.log(err));
});
Query:
What is the best way to accomplish this using ecmaScript 6 standards?