Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop over documents in mongoose

const documents = await Model.find({});

documents.forEach(doc => {
	// do something with the document
});
 
PREVIOUS NEXT
Tagged: #loop #documents #mongoose
ADD COMMENT
Topic
Name
1+7 =