In my Keystone project, I am trying to create a page that shows all posts by an author with a particular name, in this case matching the first name 'Admin'.
view.on('init', function (next) {
var q = keystone.list('View').paginate({
page: req.query.page || 1,
perPage: 5,
maxPages: 10,
filters: {
state: 'published',
author.name.first: 'Admin'
},
})
.sort('+publishedDate')
.populate('author');
q.exec(function (err, results) {
// Use results here
}
}
I have tried adding the following lines to the filters:
author.name.first: 'Admin'
author[name][first]: 'Admin'
author: {
name: {
first: 'Admin'
}
}
But none seem to work, I'm not sure how to specify it any more than just 'author'. Any ideas?