mingo
Version:
MongoDB query language for in-memory objects
18 lines (17 loc) • 511 B
JavaScript
import { $documents } from "./documents";
const isUnbounded = (window) => {
const boundary = window?.documents || window?.range;
return !boundary || boundary[0] === "unbounded" && boundary[1] === "unbounded";
};
function filterDocumentsStage(pipeline, options) {
const docs = !!pipeline && pipeline[0]?.$documents;
if (!docs) return { pipeline };
return {
documents: $documents(null, docs, options).value(),
pipeline: pipeline.slice(1)
};
}
export {
filterDocumentsStage,
isUnbounded
};