"there were emits but no data" when jsMode set to true

70 views
Skip to first unread message

Paul McCallick

unread,
May 17, 2012, 12:19:20 PM5/17/12
to mongodb-user
I'm getting the "there were emits but no data!" error message when
trying to do a simple map reduce. It works when I jsmode is false,
but not when jsmode is true.

I've looked that mongo code a bit and can't figure out what's wrong.
It looks like this error is triggered when "output" is 0. It also
looks like "output" should be getting set to _keyCt. I can verify
that _keyCt is not 0 by returning it my results, but here's what I get
from mongo:

counts" : { "input" : 28, "emit" : 76150, "reduce" : 3221, "output" :
0 }

map = "function() {emit(this.SecurityId,
{securityId:this.SecurityId,keycount:_keyCt});}";
reduce = "function(key,values){return values[0];}";

Dan Crosta

unread,
May 17, 2012, 4:43:50 PM5/17/12
to mongodb-user
Are you sure those are the right map and reduce functions? Since you
emit only once in the map function, the "emit" and "input" values
should be the same. Can you show more of the code where you call map-
reduce? (Please use a paste bin service if the code sample is very
long)

- Dan
Reply all
Reply to author
Forward
0 new messages