UNPKG

mingo

Version:

MongoDB query language for in-memory objects

12 lines (11 loc) 395 B
import { computeValue } from "../../../core/_internal"; import { assert, ensureArray } from "../../../util"; const $not = (obj, expr, options) => { const booleanExpr = ensureArray(expr); if (booleanExpr.length == 0) return false; assert(booleanExpr.length == 1, "Expression $not takes exactly 1 argument"); return !computeValue(obj, booleanExpr[0], null, options); }; export { $not };