-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.1.0
-
Component/s: JavaScript, MapReduce
-
None
-
Environment:Affected versions r2.1.0-1580-g0c1a6bd (v8), v8 engine: Version 3.9.23
Not affected versions 2.0.3-1 (spider monkey)
-
ALL
/** * js add property do not work at emit() * * @link https://jira.mongodb.org/browse/ * * Affected versions: r2.1.0-1580-g0c1a6bd (v8) * v8 engine: Version 3.9.23 * * Not affected versions: 2.0.3-1 (spider monkey) */ var testCollName = 'such-collection-can-t-exist'; var testColl = db.getCollection(testCollName); testColl.insert({key: 1, foo: {bar: 1}}); testColl.insert({key: 1, foo: {bar: 1}}); testColl.insert({key: 1, foo: {bar: 1}}); res = db.runCommand({ mapreduce: testCollName, map: function() { this.foo.additional = 1; assert(this.foo.additional, "additional not exist"); emit(this.key, {foo: this.foo}); }, reduce: function(k, vals) { return 0; }, out: {inline: 1}, // the same with "replace" and others }); printjson(res); testColl.drop();
- duplicates
-
SERVER-5379 js increment operators (ob.prop += ob2.prop) do not work, after assigment like this ob = ob2
- Closed