These are chat archives for Automattic/mongoose

14th
Feb 2019
hillct
@hillct
Feb 14 01:01
I guess it's worth pointing out that the above delete call returns 'true' as one would expect, but when evaluated, the array has not been updated
after the .foreach has completed. It just occurred to me that we're dealing with callbacks here, so is it possible that I need t promise or simply .then() to assure the foreach has completed all loops
hillct
@hillct
Feb 14 01:12
No, apparently array.forEach() is in fact synchronous, unless that doesn't apply to the version of foreach related to arrays in Mongoose documents... Any guidance?
hillct
@hillct
Feb 14 01:42
If this item from 7 years back is still valid https://stackoverflow.com/a/6938733 it might be the answer to my above inquiry... testing now...
Austyn Studdard
@KingCosmic
Feb 14 23:36
using document.set() can I add to / modify existing objects in an array