frequent errors when table does not yet exists

10 views
Skip to first unread message

olivier sallou

unread,
Feb 28, 2013, 2:37:18 AM2/28/13
to mong...@googlegroups.com
Hi,
I face frequent errors when querying a table in mongo that has not yet been filled.

I can catch errors of source but this is a bit annoying. Should not mongokit ask either table creation (empty) or return empty set?


Example:

In this case I do a mapreduce but I never inserted data before.

.....2013-02-28 07:33:03,789 ERROR [mobyle.web.stat_views][MainThread] Could not exec mapreduce on stats: command SON([('mapreduce', u'monthlystatistics'), ('map', Code('function () { for(var job in this.jobs) { emit(job, this.jobs[job]); };}', {})), ('reduce', Code("function (key, values) { var total = {}; for (var i = 0; i < values.length; i++) { if(total['key']==null) { total['key']=0; } total['key'] += values[i]; } return total;}", {})), ('out', {'inline': 1})]) failed: ns doesn't exist

I also faced the case for other find operations on Documents, when no document has been inserted before.

Thanks

Olivier
Reply all
Reply to author
Forward
0 new messages