UNPKG

mingo

Version:

MongoDB query language for in-memory objects

10 lines (9 loc) 322 B
import { ComputeOptions, computeValue } from "../../core/_internal"; const $first = (collection, expr, options) => { if (collection.length === 0) return void 0; const copts = ComputeOptions.init(options).update({ root: collection[0] }); return computeValue(collection[0], expr, null, copts); }; export { $first };