Skip to content

Commit 0289023

Browse files
committed
update delete many for use with hist
1 parent 70b0808 commit 0289023

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2030,6 +2030,10 @@ export class DatabaseConnection {
20302030
throw new Error("DeleteMany needs either a list of ids or a query");
20312031
}
20322032

2033+
const _skip_array: string[] = Config.skip_history_collections.split(",");
2034+
const skip_array: string[] = [];
2035+
_skip_array.forEach(x => skip_array.push(x.trim()));
2036+
20332037
if (collectionname === "files") { collectionname = "fs.files"; }
20342038
if (collectionname === "fs.files") {
20352039
const ot_end = Logger.otel.startTimer();
@@ -2083,7 +2087,9 @@ export class DatabaseConnection {
20832087
_version: doc._version,
20842088
reason: doc.reason
20852089
}
2086-
bulkInsert.insert(fullhist);
2090+
if (skip_array.indexOf(collectionname) == -1) {
2091+
if (!collectionname.endsWith("_hist")) bulkInsert.insert(fullhist);
2092+
}
20872093
// bulkRemove.find({ _id: doc._id }).removeOne();
20882094
bulkRemove.find({ _id: doc._id }).deleteOne();
20892095
counter++

0 commit comments

Comments
 (0)