Why does this query return an empty array with no results? There are records in the database, and I can query them if I just use a .find({ owner: req.params.ownerID }) but mongoose appears to not accept the $query...
if (!req.query.criteria) {
req.query.criteria = {
$query :{},
$orderby: {
created: -1
}
};
}
req.query.criteria['$query'].owner = req.params.ownerID;
Product.find(req.query.criteria).limit(10).exec()