File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ secrets-export.fish
103
103
mo-expansion.sh
104
104
mo-expansion.yml
105
105
expansions.sh
106
+ uri.txt
106
107
107
108
.drivers-tools /
108
109
Original file line number Diff line number Diff line change @@ -96,16 +96,13 @@ async function setupDatabase(configuration, dbsToClean) {
96
96
97
97
dbsToClean . push ( configDbName ) ;
98
98
99
- const client = configuration . newClient ( configuration . writeConcernMax ( ) ) ;
99
+ const client = configuration . newClient ( ) ;
100
100
try {
101
101
for ( const dbName of dbsToClean ) {
102
- await client
103
- . db ( dbName )
104
- . command ( { dropAllUsersFromDatabase : 1 , writeConcern : { w : 'majority' } } ) ;
105
- try {
106
- await client . db ( dbName ) . dropDatabase ( { writeConcern : { w : 'majority' } } ) ;
107
- } catch ( error ) {
108
- if ( ! error . message . match ( / d a t a b a s e i s c u r r e n t l y b e i n g d r o p p e d / ) ) throw error ;
102
+ const db = await client . db ( dbName ) ;
103
+ for await ( const { name } of db . listCollections ( { } , { nameOnly : true } ) ) {
104
+ const collection = db . collection ( name ) ;
105
+ await collection . deleteMany ( { } ) ;
109
106
}
110
107
}
111
108
} finally {
You can’t perform that action at this time.
0 commit comments