UNPKG

mingo

Version:

MongoDB query language for in-memory objects

12 lines (11 loc) 279 B
import { ensureArray } from "../../util"; import { $project } from "./project"; const $unset = (collection, expr, options) => { expr = ensureArray(expr); const doc = {}; for (const k of expr) doc[k] = 0; return $project(collection, doc, options); }; export { $unset };