I found this: Handle division by zero in mongoDB useful if I were using mongoDB directly, to resolve division by zero issue, but I couldn't found a way of doing this with Morphia.
What I need to accomplish is exactly what the refered question says, but using Morphia, that's why I don't show further code examples. Anyone could give me a tip of how can I do a division with morphia aggregation projection and returns 0 result in cases where divisor is zero?