These are chat archives for Automattic/mongoose

Oct 2017
Marko Bolliger
Oct 25 2017 14:12
Hi i have this in a Schema tasks: [{ type: Schema.Types.ObjectId, ref: 'Task' }]
then i use const project = await Project.findOneAndUpdate(
{ name: },
{ $push: { tasks: { _id: task._id } } }
and try to get it via const tasks = await Project.find().populate('tasks').exec()
but tasks just empty
the task._id is saved
nvm forgot to save the taks
Oct 25 2017 22:35
Is there a way to set locals on a model ?
I'm wondering how to do currency conversions in my virtuals
obviously the currency exchange rates change frequently
Oct 25 2017 22:40
they should shut this channel down
false hope