mingo
Version:
MongoDB query language for in-memory objects
11 lines (10 loc) • 354 B
JavaScript
import { assert, isFunction, truthy } from "../../../util/_internal";
function $where(_, rhs, options) {
assert(options.scriptEnabled, "$where: 'scriptEnabled' option must be true");
const f = rhs;
assert(isFunction(f), "$where only accepts a Function object");
return (obj) => truthy(f.call(obj), options?.useStrictMode);
}
export {
$where
};