これは私のmapreduceコードです:
DBCollection mongoCollection = MongoDAO.getCollection();
String map = "function() {"
+ "for (index in this.positions.positionList) {"
+ "emit(this._id+'|'+this.headline+'|'+"
+ "this.location.name+'|'+this.location.country.code+'|'+this.publicProfileUrl+'|'+"
+ "this.positions.positionList[index].title+'|'+"
+ "this.positions.positionList[index].company.name+'|'+this.positions.positionList[index].company.industry+'|'+"
+ "this.positions.positionList[index].company.type+'|'+this.positions.positionList[index].company.size+'|'+"
+ "this.lastName+'|'+this.firstName+'|'+this.industry+'|'+this.updatedDate+'|' , {count: 1});"
+ "}}";
String reduce = "";
MapReduceCommand mapReduceCommand = new MapReduceCommand(
mongoCollection, map, reduce.toString(), "final_result",
MapReduceCommand.OutputType.REPLACE, null);
MapReduceOutput out = mongoCollection.mapReduce(mapReduceCommand);
現在、140,000レコードを処理しています。しかし、mapreduceを実行している間、レコードの数は90,000に減少します。データセットに重複するレコードはありません。