The companies parameter that's passed into your find callback is a Cursor object, not an array. Call toArray on it to convert the query results to an array of objects, or each to process the results one at a time.
companies
find
Cursor
toArray
each
use .each on companies, instead of forEach