I have database collection like this
Fruit class
_iD
country
listNameFruit
Mango ,
Tomato,
Apple
So I have class named Fruit
and FruitName
, inside Fruit.class
I have list<FruitName>
, so I want to get my Fruit
and list of FruitName
sort by ascending
Here's my code to get the collection
MongoOperations mongoOps;
Query query = ???
mongoOps.findOne(query, Fruit.class);
I want to get my fruit data but I want the listNameFruit
is sort by ascending , what should i write in the query so i can get my list sort by ascending ?