我有一個存儲搜索查詢日誌的集合。它的兩個主要屬性是user_id和search_query。註銷用戶的user_id爲空。我正在嘗試運行mapreduce作業來查找每個用戶的計數和條款。mongo mapreduce聲明異常
var map = function(){ if(this.user_id !== null){ emit(this.user_id, this.search_query); } } var reduce = function(id, queries){ return Array.sum(queries + ","); } db.searchhistories.mapReduce(map, reduce, { query: { "time" : { $gte : ISODate("2013-10-26T14:40:00.000Z"), $lt : ISODate("2013-10-26T14:45:00.000Z") } }, out : "mr2" } )
拋出以下異常
Wed Nov 27 06:00:07 uncaught exception: map reduce failed:{ "errmsg" : "exception: assertion src/mongo/db/commands/mr.cpp:760", "code" : 0, "ok" : 0 }
我看着mr.cpp L#760但無法收集任何重要信息。什麼可能導致這個?
我的收藏有一個像
> db.searchhistories.find() { "_id" : ObjectId("5247a9e03815ef4a2a005d8b"), "results" : 82883, "response_time" : 0.86, "time" : ISODate("2013-09-29T04:17:36.768Z"), "type" : 0, "user_id" : null, "search_query" : "awareness campaign" } { "_id" : ObjectId("5247a9e0606c791838005cba"), "results" : 39545, "response_time" : 0.369, "time" : ISODate("2013-09-29T04:17:36.794Z"), "type" : 0, "user_id" : 34225174, "search_query" : "eficaz eficiencia efectividad" }
這是哪個mongodb版本? – Derick
Mongo v2.2.1。我試圖在一個從節點上運行它。 –