|
|
@@ -1,5 +1,5 @@
|
|
|
"use strict";
|
|
|
-var sift = require("sift"); //TODO: DEVIATION FROM MONGO: this was a temporary hack to get this done quickly but it is too inconsistent to keep; need a real port of MatchDocumentSource
|
|
|
+var matcher = require("../matcher/Matcher2.js");
|
|
|
|
|
|
/**
|
|
|
* A match document source built off of FilterBaseDocumentSource
|
|
|
@@ -19,7 +19,7 @@ var MatchDocumentSource = module.exports = function MatchDocumentSource(query, c
|
|
|
if (!query) throw new Error("arg `query` is required");
|
|
|
base.call(this, ctx);
|
|
|
this.query = query; // save the query, so we can check it for deps later. THIS IS A DEVIATION FROM THE MONGO IMPLEMENTATION
|
|
|
- this.matcher = sift(query);
|
|
|
+ this.matcher = matcher(query);
|
|
|
}, klass = MatchDocumentSource, base = require('./FilterBaseDocumentSource'), proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
klass.matchName = "$match";
|
|
|
@@ -59,7 +59,7 @@ proto.accept = function accept(document) {
|
|
|
* in here, and give that pDocument to create the created subset of
|
|
|
* fields, and then convert that instead.
|
|
|
**/
|
|
|
- return this.matcher.test(document);
|
|
|
+ return this.matcher.matches(document);
|
|
|
};
|
|
|
|
|
|
/**
|