@optimiser/common 1.0.279 → 1.0.282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/utility.js +4 -7
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -1797,9 +1797,7 @@ function BuildGridFieldProjection(project, field, group) {
|
|
|
1797
1797
|
project[fldName] = 1;
|
|
1798
1798
|
project[alias] = 1;
|
|
1799
1799
|
for (var i = 0; i < field.Schema.LookupFields.length; i++) {
|
|
1800
|
-
|
|
1801
|
-
// added by Shahzaib, make int to string and concat
|
|
1802
|
-
searchConcatArry.push({ "$ifNull": [{ $toString: '$' + alias + '.' + field.Schema.LookupFields[i] }, ""] });
|
|
1800
|
+
searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "]] });
|
|
1803
1801
|
if (i < field.Schema.LookupFields.length - 1) {
|
|
1804
1802
|
searchConcatArry.push([" "]);
|
|
1805
1803
|
}
|
|
@@ -1810,7 +1808,8 @@ function BuildGridFieldProjection(project, field, group) {
|
|
|
1810
1808
|
$reduce: {
|
|
1811
1809
|
input: { $concatArrays: searchConcatArry },
|
|
1812
1810
|
initialValue: "",
|
|
1813
|
-
in: { $concat: ["$$value", "$$this"] }
|
|
1811
|
+
//in: { $concat: ["$$value", "$$this"] } // Commented by and below line was added by Shahzaib, make int to string
|
|
1812
|
+
in: { $concat: ["$$value", { $toString: "$$this" }] }
|
|
1814
1813
|
}
|
|
1815
1814
|
};
|
|
1816
1815
|
break;
|
|
@@ -1840,9 +1839,7 @@ function BuildGridFieldProjection(project, field, group) {
|
|
|
1840
1839
|
project[alias] = 1;
|
|
1841
1840
|
if (field.Schema.LookupObject) {
|
|
1842
1841
|
for (var i = 0; i < field.Schema.LookupFields.length; i++) {
|
|
1843
|
-
|
|
1844
|
-
// added by Shahzaib, make int to string and concat
|
|
1845
|
-
searchConcatArry.push({ "$ifNull": [{ $toString: '$' + alias + '.' + field.Schema.LookupFields[i] }, [" "]] });
|
|
1842
|
+
searchConcatArry.push({ "$ifNull": ['$' + alias + '.' + field.Schema.LookupFields[i], [" "]] });
|
|
1846
1843
|
if (i < field.Schema.LookupFields.length - 1) {
|
|
1847
1844
|
searchConcatArry.push([" "]);
|
|
1848
1845
|
}
|