Reputation: 38
This may have been answered but I just couldn't find it, what is the suggested way to convert a month number to month name for a value returned in MongoDB.
Upvotes: 0
Views: 985
Reputation: 1379
The best way is to create ENUM class supports that mapping.
public enum Month {
JANUARY, FEBRUARY, MARCH, APRIL; //...
}
It should not be an issue of the MongoDB. The calls to the database are expensive and you do not want to spend time on simple constants data.
Upvotes: 1