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

Function createLogicalQueryOperatorHandler

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

Source from the content-addressed store, hash-verified

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

Callers 1

array.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected