What's new in Spring Data MongoDB 1.4 M1
As the first milestone of the Spring Data release train Codd has now cooled down a little bit, I'd like to highlight some of the new features shipped with the MongoDB module.
SpEL support for projections in aggregation framework
Sometimes it can be pretty complicated to define arithmetic expressions within MongoDB aggregation framework projections.
Assume a part of an aggregation for an order is the gross price of it, effectively calculated using the following formula: (netPrice * discountRate + fixedCharge) * taxRate
. With a discount rate of 0.8, a fixed charge of 1.2 and a tax rate of 1.19, the according DBObject
to encode this formula with the MongoDB aggregation…