mingo
Version:
MongoDB query language for in-memory objects
12 lines (11 loc) • 366 B
JavaScript
import { computeValue } from "../../../core/_internal";
import { isString } from "../../../util";
import { errExpectString } from "../_internal";
const $strLenCP = (obj, expr, options) => {
const s = computeValue(obj, expr, null, options);
if (!isString(s)) return errExpectString(options.failOnError, "$strLenCP");
return s.length;
};
export {
$strLenCP
};