These are chat archives for Automattic/mongoose

22nd
Feb 2019
tbadlov
@tbadlov
Feb 22 03:09
Hello all, how can we use mongoose to update an array of documents and override data ?
I tried using Model.create( arrayOfDocs) but it always considers the data to be new.
the data shape is such that it has no _id but there are other properties that has a match (like accountId)
tbadlov
@tbadlov
Feb 22 03:52
could it be that i cannot do a forEach on an array and then run Model.findOne() on each record?