UNPKG

@drip_sync/drip

Version:

Scalable incremental sync for MongoDB aggregation pipelines

8 lines (7 loc) 274 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stripToGate = stripToGate; function stripToGate(pipeline) { const lastMatchIndex = pipeline.map((s) => s.type).lastIndexOf("match"); return pipeline.slice(0, lastMatchIndex + 1); }