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