protected void mapReduceOperationCanBeExecuted() {
final DBCollection<Map<String, Object>> collection = context.openCollection("foo2");
for (int a = 0; a < 10; a++) {
collection.save(newDoc(new ObjectId(), a));
}
MapReduce mapReduce = new MapReduce("function(){emit(this.foo%2==0?\"even\":\"odd\",1); }", "function(k, vals){ var sum=0; for(var i in vals) sum += vals[i]; return sum;}");
mapReduce.setVerbose(true);
MapReduceResult result = collection.query(mapReduce, new Query());
specify(result.wasOk());
}