When using map-reduce with sorting, I am getting this error:
uncaught exception: map reduce failed:{
"errmsg" : "exception: could not create cursor over .... for query : { col1: { $gt: new Date(1377982800000) }, col2: { $gt: 0.0 } } sort : { Time: 1.0 }",
"code" : 16052,
"ok" : 0
}
I searched for the error code, but could not find a fix. After a few hours of trial and error, I realised my problem: the column I was sorting on was not the key column of the map method. Turns out you can't use sort on map-reduce on column other than the key column.
Hope this helps.