Note that there are some explanatory texts on larger screens.

plurals
  1. POMongo Map Reduce error
    text
    copied!<p>Being a newbie to MongoDB I'm trying to get a MapReduce call going. Unfortunately I get the following error:</p> <pre><code>mongos&gt; db.events.mapReduce(m,r,"errors"); Fri Apr 12 11:39:15.637 JavaScript execution failed: map reduce failed:{ "ok" : 0, "errmsg" : "MR parallel processing failed: { errmsg: \"exception: reduce -&gt; multiple not supported yet\", code: 10075, ok: 0.0 }" } at src/mongo/shell/collection.js:L970 mongos&gt; </code></pre> <p>I'm using Mongo 2.4.0</p> <p>My events collection looks like this:</p> <pre><code>{ "sid" : "1UADM45MCGRTW ", "time" : ISODate("2013-04-08T11:33:13.229Z"), "class" : "S", "service" : "service1" } { "sid" : "1UADM45MCGRTW ", "time" : ISODate("2013-04-08T11:33:13.229Z"), "class" : "I", "service" : "service1" } { "sid" : "1UADM45MCGRTW ", "time" : ISODate("2013-04-08T11:33:13.236Z"), "class" : "E", "text" : "error message" } { "sid" : "1UADM45MCGRTW ", "time" : ISODate("2013-04-08T11:33:13.239Z"), "class" : "F", "service" : "service1" } { "sid" : "1UDO3H7YUOK08 ", "time" : ISODate("2013-04-08T11:33:08.095Z"), "class" : "S", "service" : "service2" } { "sid" : "1UDO3H7YUOK08 ", "time" : ISODate("2013-04-08T11:33:08.095Z"), "class" : "I", "service" : "service2" } { "sid" : "1UDO3H7YUOK08 ", "time" : ISODate("2013-04-08T11:33:08.173Z"), "class" : "E", "text" : "another error message" } { "sid" : "1UDO3H7YUOK08 ", "time" : ISODate("2013-04-08T11:33:08.188Z"), "class" : "F", "service" : "service2" } { "sid" : "1UDO3JVXIS2UZ ", "time" : ISODate("2013-04-08T11:28:39.480Z"), "class" : "I", "service" : "service1" } { ""sid" : "1UDO3JVXIS2UZ ", "time" : ISODate("2013-04-08T11:28:39.480Z"), "class" : "S", "service" : "service1" } { "sid" : "1UDO3JVXIS2UZ ", "time" : ISODate("2013-04-08T11:28:40.853Z"), "class" : "F", "service" : "service1" } { "sid" : "1UDO3JVXIS2UZ ", "time" : ISODate("2013-04-08T11:28:40.852Z"), "class" : "I", "service" : "service1" } </code></pre> <p>My intention is to get all "E" entries and combine them with the "service" field of the corresponding "sid" of a "F" entry. So this should be very simple but I couldn't get it going (because of the above error).</p> <p>The map/reduce functions I used are:</p> <pre><code>var m = function() { if (this.class == "E") { value = { time: this.time, error: this.text }; emit(this.sid, value); } else if (this.class == "F") { value = { service: this.service }; emit(this.sid, value); } } var r = function(key,values) { return values; } db.events.mapReduce(m,r,"errors"); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload