These are chat archives for Automattic/mongoose

28th
Oct 2016
Paul "Joey" Clark
@joeytwiddle
Oct 28 2016 10:07
Use promises to make 3 queries in parallel:
const studentsPromise = Student.find({…}).exec();
const classesPromise  =   Class.find({…}).exec();
...

Promise.all([studentsPromise, classesPromise, teachersPromise])
    .then(results => {
        console.log(’Teachers are:’, results[2]);
    })
    .catch(console.error);
@peb7268
temuccio
@temuccio
Oct 28 2016 13:54
Hello all, for my problem I have solved with $elemMatch directive
Joseph Thibeault
@jrthib
Oct 28 2016 18:14
at what points during a document’s lifecycle do the setters get run?
i figured out that they run when you do new TestModel(), and when you set properties on a doc.
to they ever get ran again before validation or save?