Open kodelio opened 6 years ago
Hi,
I'm trying to sort my results with a field which is inside a populate :
let query = {$or:[{name: { "$regex": params.search, "$options": "i" }}, {_id: { "$regex": params.search, "$options": "i" }}]}; let options = { offset: params.offset, limit: params.limit, populate: { path: '_id', options: { sort: { 'MktCapUSD': -1 } } } }; return Models.Asset.paginate(query, options).then(function (result) { return result; }).catch((err) => { throw err; });
But it's ignoring my sort query.
I am experiencing the same issue which makes me abandon this plugin and use Mongo's aggregate function instead. If this ever resolved please let me know.
Hi,
I'm trying to sort my results with a field which is inside a populate :
But it's ignoring my sort query.