2012-05-14 99 views
2

iReport是否支持MapReduce? (与MongoDB的) simple query 我想知道我是否可以把地图上的JasperServer在这个窗口减少查询,如果没有对报告(当您上传您的.jrxml你有一个“查询”选项卡)MapReduce和iReport/Jasperserver(MongoDB)?

感谢

回答

4

是的,它的确如此。例如:

{ 
    collectionName : 'dataByZipCode', 
    sort : { 
    'value.population' : -1, 
    }, 
    mapReduce : { 
    map : 'function() { 
       emit (this.state, {population : this.pop}); 
      }', 
    reduce : 'function (key, values) { 
        var total = 0; 
        for(var index = 0; index < values.length; index ++) { 
        total += values[index].population; 
        } 
        return {population : total} 
       }', 
    out : 'totalPopulation' 
    } 
} 

Jaspersoft MongoDB Connector Query Reference