Closed nssafir closed 3 years ago
In the following piece of code: await User.find({ recievePromotions : true }).map(function (doc) { \\ body }) what should i put in body to iterate through each item returned by User.find?
await User.find({ recievePromotions : true }).map(function (doc) { \\ body })
I think you can just do doc.email. if not console log doc to see what it gives you. Also check out the mongoose wiki
doc.email
In the following piece of code:
await User.find({ recievePromotions : true }).map(function (doc) { \\ body })
what should i put in body to iterate through each item returned by User.find?