map = function() { emit(this.school_number, this.ticket_number) };
reduce = function(key, value){ return Array.sum(',' + value).slice(1); };
db.tickets.mapReduce(map, reduce, {out: {inline:1}})
db.tickets.mapReduce(map, reduce, {out: {inline:1}, query: {"school_bucket": "1"}})
db.tickets.mapReduce(map, reduce, {out: {inline:1}, query: {"school_number": "2719"}})
db.tickets.mapReduce(map, reduce, “output”)
db.output.find()
阅读(1249) | 评论(1) | 转发(0) |