leodinas-hao / mongoose-query-parser

Convert url query string to MongooseJs friendly query object including advanced filtering, sorting, population, string template, type casting and many more...
MIT License
68 stars 17 forks source link

Support filter / search / sort in the populate #30

Open chintanshahts opened 1 year ago

chintanshahts commented 1 year ago

mongoose populate with sort

WizardModel.find({})
.populate({
path: 'spells',
options: { sort: [['damages', 'asc']] }
})

mongoose populate with match


WizardModel.find({})
.populate({
path: 'spells',
match: { level_required: { $gte: 3 } }
})
chintanshahts commented 1 year ago

@leodinas-hao any planning on this?