|
|
@@ -1,20 +1,27 @@
|
|
|
"use strict";
|
|
|
|
|
|
-// Autogenerated by cport.py on 2013-09-17 14:37
|
|
|
-var Matcher2 = module.exports = function Matcher2(pattern, whereCallback){
|
|
|
+/**
|
|
|
+ * Matcher is a simple wrapper around a JSONObj and the MatchExpression created from it.
|
|
|
+ * @class Matcher
|
|
|
+ * @namespace mungedb-aggregate.pipeline.matcher
|
|
|
+ * @module mungedb-aggregate
|
|
|
+ * @constructor
|
|
|
+ */
|
|
|
+var Matcher = module.exports = function Matcher(pattern, whereCallback){
|
|
|
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 = Matcher2, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
+}, klass = Matcher, base = Object, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
|
|
|
|
|
|
// DEPENDENCIES
|
|
|
var errors = require("../../Errors.js"),
|
|
|
ErrorCodes = errors.ErrorCodes,
|
|
|
MatchExpressionParser = require("./MatchExpressionParser.js"),
|
|
|
|
|
|
+//PROTOTYPE MEMBERS
|
|
|
proto._expression = undefined;
|
|
|
proto._pattern = undefined;
|
|
|
|