I made a file called test-for-each-loop.js in NodeJS to attempt to save a record to a mongodb database via the mongoose db wrapper. It looks like this:
test-for-each-loop.js