UNPKG

mingo

Version:

MongoDB query language for in-memory objects

11 lines (10 loc) 348 B
import { computeValue } from "../../../core/_internal"; import { assert, isArray, truthy } from "../../../util/_internal"; const $and = (obj, expr, options) => { assert(isArray(expr), "$and expects array"); const mode = options.useStrictMode; return expr.every((e) => truthy(computeValue(obj, e, null, options), mode)); }; export { $and };