Aligned projectFiled naming with the backend
MODIFY
src/storage/mongodb/DatabaseUtils.ts
src/storage/mongodb/DatabaseUtils.ts
@@ -187,7 +187,7 @@ export default class DatabaseUtils {
}
}
// Add Projected fields
- DatabaseUtils.projectFields(pipeline, lookupParams.projectedFields);
+ DatabaseUtils.projectFields(pipeline, lookupParams.projectFields);
// Create Lookup
lookupParams.aggregation.push({
$lookup: {
@@ -240,12 +240,12 @@ export default class DatabaseUtils {
aggregation.push(DatabaseUtils.buildChargingStationInactiveFlagQuery());
}
- public static projectFields(aggregation: any[], projectedFields: string[], removedFields: string[] = []): void {
- if (!Utils.isEmptyArray(projectedFields)) {
+ public static projectFields(aggregation: any[], projectFields: string[], removedFields: string[] = []): void {
+ if (!Utils.isEmptyArray(projectFields)) {
const project = {
$project: {}
};
- for (const projectedField of projectedFields) {
+ for (const projectedField of projectFields) {
project.$project[projectedField] = 1;
}
for (const removedField of removedFields) {

MODIFY
src/types/database/DbLookup.ts
src/types/database/DbLookup.ts
@@ -6,7 +6,7 @@ export default interface DbLookup {
foreignField: string;
asField: string;
objectIDFields?: string[];
- projectedFields?: string[];
+ projectFields?: string[];
count?: boolean;
oneToOneCardinality?: boolean;
oneToOneCardinalityNotNull?: boolean;

Aligned projectFiled naming with the backend