mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
0f36fdce71
create mode 100644 jstests/noPassthrough/mr_noscripting.js delete mode 100644 jstests/noPassthroughWithMongod/mr_noscripting.js create mode 100644 jstests/sharding/agg_js_on_mongos.js create mode 100644 jstests/sharding/javascript_heap_limit.js
24 lines
537 B
JavaScript
24 lines
537 B
JavaScript
// Tests that running mapReduce does not crash mongod if scripting is disabled.
|
|
(function() {
|
|
"use strict";
|
|
|
|
const conn = MongoRunner.runMongod({noscripting: ''});
|
|
const testDB = conn.getDB('foo');
|
|
const coll = testDB.bar;
|
|
|
|
assert.commandWorked(coll.insert({x: 1}));
|
|
|
|
const map = function() {
|
|
emit(this.x, 1);
|
|
};
|
|
|
|
const reduce = function(key, values) {
|
|
return 1;
|
|
};
|
|
|
|
assert.commandFailedWithCode(
|
|
testDB.runCommand({mapReduce: 'bar', map: map, reduce: reduce, out: {inline: 1}}), 31264);
|
|
|
|
MongoRunner.stopMongod(conn);
|
|
}());
|