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

Function createLogicalQueryOperatorHandler

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

Source from the content-addressed store, hash-verified

638handle.$nor = createLogicalQueryOperatorHandler('$nor');
639
640function createLogicalQueryOperatorHandler(op) {
641 return function logicalQueryOperatorHandler(val) {
642 if (!Array.isArray(val)) {
643 throw new TypeError('conditional ' + op + ' requires an array');
644 }
645
646 const ret = [];
647 for (const obj of val) {
648 ret.push(cast(this.casterConstructor.schema, obj, null, this && this.$$context));
649 }
650
651 return ret;
652 };
653}
654
655handle.$near =
656handle.$nearSphere = geospatial.cast$near;

Callers 1

array.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected