Skip to content

Commit 56a2f7c

Browse files
author
tombertrand
committed
Replace drop by deleteMany to preserve the indexes
1 parent 1ceeb93 commit 56a2f7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/cron/nodeLocations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const doNodeLocations = async () => {
103103
throw new Error("Mongo unavailable for doNodeLocations");
104104
}
105105

106-
await database.collection(NODE_LOCATIONS).drop();
106+
await database.collection(NODE_LOCATIONS).deleteMany({});
107107
await database.collection(NODE_LOCATIONS).insertMany(results);
108108

109109
nodeCache.set(NODE_LOCATIONS, results);

0 commit comments

Comments
 (0)