I am using Morphia to communicate with MongoDb. When annotating fields with @Indexed, it's allowed to specify the IndexDirection of DESC, ASC, BOTH, GEO2D, what's the purpose of those separately?
If I specify BOTH, does it mean that there would have two indexes created?
And also, if I want the filtered entities to be order in descending order, does it mean that I'd better to have the index to have IndexDirection of DESC?
DESC = Descending, ASC = Ascending, and GEO2D = 2D/Geography
BOTH is not a valid option unfortunately. That was a mistake of the enum definition and no longer exists.
They indicate how the values are stored in the index. For a single index the direction is not important.
For compound indexes you can specify the orders for each field and it will make a difference. See the docs on the mongodb site for specifics.