Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop over documents in mongoose

for await (const doc of Model.find()) {
  doc.name = "New Name"
  await doc.save();
}
 
PREVIOUS NEXT
Tagged: #loop #documents #mongoose
ADD COMMENT
Topic
Name
8+2 =