Optimized deleted flag
MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -196,7 +196,9 @@ export default class ChargingStationStorage {
];
}
// Remove deleted
+ if (!params.includeDeleted) {
filters.deleted = { '$ne': true };
+ }
// Charging Stations
if (!Utils.isEmptyArray(params.chargingStationIDs)) {
filters._id = {
@@ -219,10 +221,6 @@ export default class ChargingStationStorage {
}
// Add Charging Station inactive flag
DatabaseUtils.pushChargingStationInactiveFlag(aggregation);
- // Include deleted charging stations if requested
- if (params.includeDeleted) {
- delete filters.deleted;
- }
// Add in aggregation
aggregation.push({
$match: filters

Optimized deleted flag