hunterwilkins2 / bulldog-books

An online bookstore for UGA CSCI 4050. Created with React and Node.
MIT License
2 stars 3 forks source link

How to Iterate through each item of .find results #60

Closed nssafir closed 3 years ago

nssafir commented 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?

hunterwilkins2 commented 3 years ago

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