MCPcopy Create free account
hub / github.com/Automattic/mongoose / createLogicalQueryOperatorHandler

Function createLogicalQueryOperatorHandler

lib/schema/array.js:657–670  ·  view source on GitHub ↗
(op)

Source from the content-addressed store, hash-verified

655handle.$nor = createLogicalQueryOperatorHandler('$nor');
656
657function createLogicalQueryOperatorHandler(op) {
658 return function logicalQueryOperatorHandler(val, context) {
659 if (!Array.isArray(val)) {
660 throw new TypeError('conditional ' + op + ' requires an array');
661 }
662
663 const ret = [];
664 for (const obj of val) {
665 ret.push(cast(this.embeddedSchemaType.schema ?? context.schema, obj, null, this?.$$context));
666 }
667
668 return ret;
669 };
670}
671
672handle.$near =
673handle.$nearSphere = geospatial.cast$near;

Callers 1

array.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected