These are chat archives for Automattic/mongoose

25th
Oct 2017
Marko Bolliger
@cannap
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: message.channel.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
task
realisation
@realisation
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
realisation
@realisation
Oct 25 2017 22:40
they should shut this channel down
false hope