Files
mongo/jstests/aggregation/bugs/server6335.js
2023-08-06 20:48:04 +00:00

7 lines
298 B
JavaScript

// server-6335: don't allow $where clauses in a $match
import {assertErrorCode} from "jstests/aggregation/extras/utils.js";
assertErrorCode(db.foo, {$match: {$where: "return true"}}, ErrorCodes.BadValue);
assertErrorCode(db.foo, {$match: {$and: [{$where: "return true"}]}}, ErrorCodes.BadValue);