|
@@ -415,6 +415,10 @@ proto.makeDocument = function makeDocument(id, accums, mergeableOutput) {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Computes the internal representation of the group key.
|
|
* Computes the internal representation of the group key.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @method computeId
|
|
|
|
|
+ * @param vars a VariablesParseState
|
|
|
|
|
+ * @return vals
|
|
|
*/
|
|
*/
|
|
|
proto.computeId = function computeId(vars) {
|
|
proto.computeId = function computeId(vars) {
|
|
|
var self = this;
|
|
var self = this;
|
|
@@ -434,6 +438,10 @@ proto.computeId = function computeId(vars) {
|
|
|
/**
|
|
/**
|
|
|
* Converts the internal representation of the group key to the _id shape specified by the
|
|
* Converts the internal representation of the group key to the _id shape specified by the
|
|
|
* user.
|
|
* user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @method expandId
|
|
|
|
|
+ * @param val
|
|
|
|
|
+ * @return document representing an id
|
|
|
*/
|
|
*/
|
|
|
proto.expandId = function expandId(val) {
|
|
proto.expandId = function expandId(val) {
|
|
|
var self = this;
|
|
var self = this;
|
|
@@ -457,6 +465,12 @@ proto.expandId = function expandId(val) {
|
|
|
return doc;
|
|
return doc;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Parses the raw id expression into _idExpressions and possibly _idFieldNames.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @method parseIdExpression
|
|
|
|
|
+ * @param groupField {Object} The object with the spec
|
|
|
|
|
+ */
|
|
|
proto.parseIdExpression = function parseIdExpression(groupField, vps) {
|
|
proto.parseIdExpression = function parseIdExpression(groupField, vps) {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
if (self._getTypeStr(groupField) === 'Object' && Object.keys(groupField).length !== 0) {
|
|
if (self._getTypeStr(groupField) === 'Object' && Object.keys(groupField).length !== 0) {
|
|
@@ -487,7 +501,6 @@ proto.parseIdExpression = function parseIdExpression(groupField, vps) {
|
|
|
* @method _getTypeStr
|
|
* @method _getTypeStr
|
|
|
* @param obj {Object} The object to get the type of
|
|
* @param obj {Object} The object to get the type of
|
|
|
* @return {String} The type of the object as a string
|
|
* @return {String} The type of the object as a string
|
|
|
- * @async
|
|
|
|
|
**/
|
|
**/
|
|
|
proto._getTypeStr = function _getTypeStr(obj) {
|
|
proto._getTypeStr = function _getTypeStr(obj) {
|
|
|
var typeofStr = typeof obj,
|
|
var typeofStr = typeof obj,
|