MCPcopy
hub / github.com/Automattic/mongoose / createLogicalQueryOperatorHandler

Function createLogicalQueryOperatorHandler

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

Source from the content-addressed store, hash-verified

632handle.$nor = createLogicalQueryOperatorHandler('$nor');
633
634function createLogicalQueryOperatorHandler(op) {
635 return function logicalQueryOperatorHandler(val, context) {
636 if (!Array.isArray(val)) {
637 throw new TypeError('conditional ' + op + ' requires an array');
638 }
639
640 const ret = [];
641 for (const obj of val) {
642 ret.push(cast(this.embeddedSchemaType.schema ?? context.schema, obj, null, this?.$$context));
643 }
644
645 return ret;
646 };
647}
648
649handle.$near =
650handle.$nearSphere = geospatial.cast$near;

Callers 1

array.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…