UNPKG

mingo

Version:

MongoDB query language for in-memory objects

11 lines (10 loc) 325 B
import { Query } from "../../../query"; import { assert, isArray } from "../../../util"; const $and = (_, rhs, options) => { assert(isArray(rhs), "$and expects value to be an Array."); const queries = rhs.map((expr) => new Query(expr, options)); return (obj) => queries.every((q) => q.test(obj)); }; export { $and };