These are chat archives for Automattic/mongoose

7th
Oct 2017
Rakesh Kashyap
@rakesh1988
Oct 07 2017 15:56
is it possible to Add a field dynamically to mongose schema without saving it into database
i need to add a field to my model based on the result from another mongoose.find.. is this possible?
Christoph Diehl
@posidron
Oct 07 2017 16:12
NEW_entries.forEach(function (entry) {
  let entry = new ReferencedModel(entry)
  Model1.entries.push(entry).save()
})
is it possible to (1) add NEW_entries to the "ref" named "entries" in a batch and (2) how can i make it happen to add those new entries to the top rather than bottom?
Christoph Diehl
@posidron
Oct 07 2017 17:18
nvm