Thursday 4 May 2017

mongoose find query $in giving priority for specific item

I want to query the Mongodb using following mongoose query. And I want to give priority for specific brand and get the inventories of that brand first. How can I give priority for specific brand and get those results first rather than other brands.

db.inventory.find( { brand: { $in: [ 'brand1', 'brand2', 'brand3' ] } } )



via Manoj Sanjeewa

No comments:

Post a Comment