repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'main' into patch-1
[e-mobility-charging-stations-simulator.git]
/
src
/
scripts
/
deleteChargingStations.js
diff --git
a/src/scripts/deleteChargingStations.js
b/src/scripts/deleteChargingStations.js
index 3a46893a64cf1b8390aebae84be71d7959198f9f..f92cdcf1a7ea0d9573185af3a174a7f161d7108d 100755
(executable)
--- a/
src/scripts/deleteChargingStations.js
+++ b/
src/scripts/deleteChargingStations.js
@@
-1,12
+1,13
@@
#!/usr/bin/env node
#!/usr/bin/env node
-const MongoClient = require('mongodb');
const fs = require('fs');
const fs = require('fs');
+const MongoClient = require('mongodb');
+
// This script deletes charging stations
// Filter charging stations by id pattern
// This script deletes charging stations
// Filter charging stations by id pattern
-// Use Case: emobility-charging-stations-simulator creates thousands of charging stations, which are not longer needed.
+// Use Case: e
-
mobility-charging-stations-simulator creates thousands of charging stations, which are not longer needed.
// Delete these charging stations all at once
// Config
// Delete these charging stations all at once
// Config
@@
-21,7
+22,7
@@
if (config && config.mongoConnectionString) {
const response = await db
.collection(tenantID + '.chargingstations')
.deleteMany({ _id: { $regex: config.idPattern } });
const response = await db
.collection(tenantID + '.chargingstations')
.deleteMany({ _id: { $regex: config.idPattern } });
- console.
log
(
+ console.
info
(
response.deletedCount,
`Charging Stations with id = %${config.idPattern}% deleted. TenantID =`,
tenantID
response.deletedCount,
`Charging Stations with id = %${config.idPattern}% deleted. TenantID =`,
tenantID