0
지도를 Mongo로 바로 이동하여 최상위 태그를 얻으려고하지만이 오류가 발생하고 어떤 의미인지, 그 이유는 무엇인지 모르겠습니다. 어떤 지침?지도 축소 오류 : MongoDB
> reduce= function(previous, current) {
... var count = 0;
...
... for (index in current) {
... count += current[index];
... }
...
... return count;
... }
function (previous, current) {
var count = 0;
for (index in current) {
count += current[index];
}
return count;
}
> reduce
function (previous, current) {
var count = 0;
for (index in current) {
count += current[index];
}
return count;
}
> map = function() {
... if (!this.stores) {
... return;
... }
... for (index in this.stores) {
... emit(this.stores[index], 1);
... }
... }
function() {
if (!this.stores) {
return;
}
for (index in this.stores) {
emit(this.stores[index], 1);
}
}
> map
function() {
if (!this.stores) {
return;
}
for (index in this.stores) {
emit(this.stores[index], 1);
}
}
> result = db.runCommand({
... "mapreduce" : "users",
... "map" : map,
... "reduce" : reduce,
... "out" : "tags"})
{
"assertion" : "_id cannot be an array",
"assertionCode" : 10099,
"errmsg" : "db assertion failure",
"ok" : 0
}