The operation: #<Moped::Protocol::Command
@length=557
@request_id=4
@response_to=0
@op_code=2004
@flags=[]
@full_collection_name="pracker_development.$cmd"
@skip=0
@limit=-1
@selector={:mapreduce=>"pixels", :map=>"\n
function() {\n
if(this.tags){\n
this.tags.forEach(function(tag){\n
emit(tag, 1)\n
});\n
}\n
}\n ", :reduce=>"\n
function(key, values) {\n
var tag_count = 0 ;\n
values.forEach(function(value) {\n
tag_count += value;\n
});\n
return tag_count;\n
}\n ", :query=>{}, :out=>{:inline=>true}}
@fields=nil>
failed with error 9014: "exception: map invoke failed: JS Error: TypeError: this.tags.forEach is not a function nofile_b:2"
See https://github.com/mongodb/mongo/blob/master/docs/errors.md
for details about this error.
使用 Pixel.all_tags 会发生此错误
我过去有这个,但我能想出的唯一解决方案是删除集合并重新开始......
github问题: https ://github.com/chebyte/mongoid-simple-tags/issues/21