|
|
@@ -1,20 +1,20 @@
|
|
|
"use strict";
|
|
|
|
|
|
/**
|
|
|
- * Matcher is a simple wrapper around a JSONObj and the MatchExpression created from it.
|
|
|
- * @class Matcher
|
|
|
- * @namespace mungedb-aggregate.pipeline.matcher
|
|
|
+ * Matcher2 is a simple wrapper around a JSONObj and the MatchExpression created from it.
|
|
|
+ * @class Matcher2
|
|
|
+ * @namespace mungedb-aggregate.pipeline.matcher2
|
|
|
* @module mungedb-aggregate
|
|
|
* @constructor
|
|
|
*/
|
|
|
-var Matcher = module.exports = function Matcher(pattern, whereCallback){
|
|
|
+var Matcher2 = module.exports = function Matcher2(pattern, nested){
|
|
|
this._pattern = pattern;
|
|
|
this.parser = new MatchExpressionParser();
|
|
|
var result = this.parser.parse(pattern);
|
|
|
if (result.code != ErrorCodes.OK)
|
|
|
return {code:16810, description:"bad query: " + result};
|
|
|
this._expression = result.result;
|
|
|
-}, klass = Matcher, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
+}, klass = Matcher2, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
// DEPENDENCIES
|
|
|
var errors = require("../../Errors.js"),
|