Thank you, I have got the right code, but my problem changed to another one : I got an ClassCastException when converting elements from counts :
Code:
return new MapReduceCounts((Integer) counts.get("input"), (Integer) counts.get("emit"),
(Integer) counts.get("output"));
The exception tjava.lang.ClassCastException:
Code:
java.lang.Long cannot be cast to java.lang.Integer
at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.parseCounts(MapReduceResults.java:125)
at org.springframework.data.mongodb.core.mapreduce.MapReduceResults.<init>(MapReduceResults.java:54)
at org.springframework.data.mongodb.core.MongoTemplate.mapReduce(MongoTemplate.java:1027)
at org.springframework.data.mongodb.core.MongoTemplate.mapReduce(MongoTemplate.java:982)
I use MongoDB 2.0.6 and connect to a mogos fro sharding.