File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ secrets-export.fish
103103mo-expansion.sh
104104mo-expansion.yml
105105expansions.sh
106+ uri.txt
106107
107108.drivers-tools /
108109
Original file line number Diff line number Diff line change @@ -96,16 +96,13 @@ async function setupDatabase(configuration, dbsToClean) {
9696
9797 dbsToClean . push ( configDbName ) ;
9898
99- const client = configuration . newClient ( configuration . writeConcernMax ( ) ) ;
99+ const client = configuration . newClient ( ) ;
100100 try {
101101 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 ( { } ) ;
109106 }
110107 }
111108 } finally {
You can’t perform that action at this time.
0 commit comments