These are chat archives for Automattic/mongoose

27th
Apr 2017
Johnson
@GideonJ
Apr 27 2017 12:37
Is it possible to do something like this with mongoose? https://docs.mongodb.com/v3.0/tutorial/create-an-auto-incrementing-field/
Not sure how to set the field to call a function on the mongo server
QMYT
@brokleen
Apr 27 2017 14:27
hi !
I have a question about populate and match option
articleModel.find()
.populate({
    path: 'author',
    match: { name: 'John'}
})
.exec(function (err, articles) {
    if (err) return handleError(err);
    console.log(articles.length);
});
Articles.lenght return 2
but John has only one article
QMYT
@brokleen
Apr 27 2017 14:35
So, how to find articles that belong to John ?