|
|
|
@ -390,16 +390,22 @@ lastStepModifierFunctions.$inc = function (obj, field, value) { |
|
|
|
|
* Updates the value of the field, only if specified field is greater than the current value of the field |
|
|
|
|
*/ |
|
|
|
|
lastStepModifierFunctions.$max = function (obj, field, value) { |
|
|
|
|
if (typeof obj[field] === 'undefined') obj[field] = value; |
|
|
|
|
else if (value > obj[field]) obj[field] = value; |
|
|
|
|
if (typeof obj[field] === 'undefined') { |
|
|
|
|
obj[field] = value; |
|
|
|
|
} else if (value > obj[field]) { |
|
|
|
|
obj[field] = value; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Updates the value of the field, only if specified field is smaller than the current value of the field |
|
|
|
|
*/ |
|
|
|
|
lastStepModifierFunctions.$min = function (obj, field, value) { |
|
|
|
|
if (typeof obj[field] === 'undefined') obj[field] = value; |
|
|
|
|
else if (value < obj[field]) obj[field] = value; |
|
|
|
|
if (typeof obj[field] === 'undefined') {
|
|
|
|
|
obj[field] = value; |
|
|
|
|
} else if (value < obj[field]) { |
|
|
|
|
obj[field] = value; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// Given its name, create the complete modifier function
|
|
|
|
|