UNPKG

mingo

Version:

MongoDB query language for in-memory objects

16 lines (15 loc) 365 B
import { ComputeOptions, evalExpr } from "../../../core/_internal"; const $let = (obj, expr, options) => { const variables = {}; for (const key of Object.keys(expr.vars)) { variables[key] = evalExpr(obj, expr.vars[key], options); } return evalExpr( obj, expr.in, ComputeOptions.init(options).update({ variables }) ); }; export { $let };