I want to order the records in result set. How can I receive the results in MongoDB like what I expected. In MySQL, I can use the following query to get my expected way of sort.
But how can I get in MongoDB.
SELECT * FROM fruit
ORDER BY FIELD(name, 'Banana', 'Apple', 'Pear', 'Orange'), variety;
Please advice. Thanks!