forEach( function )
functionto each document from the cursor.
forEach()method has the following prototype form:
forEach()method has the following parameter:
Parameter Type Description
<function>signature includes a single argument that is passed the current document to process.