mingo
Version:
MongoDB query language for in-memory objects
14 lines (13 loc) • 397 B
JavaScript
import { computeValue } from "../../../core/_internal";
import { isNil } from "../../../util";
import { errExpectNumber } from "../_internal";
const $ceil = (obj, expr, options) => {
const n = computeValue(obj, expr, null, options);
if (isNil(n)) return null;
if (typeof n !== "number")
return errExpectNumber(options.failOnError, "$ceil");
return Math.ceil(n);
};
export {
$ceil
};