File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
source/code-snippets/usage-examples Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 11// Delete multiple documents
22
3- // Import the MongoClient type from the mongodb package
43import { MongoClient } from "mongodb" ;
54
65// Replace the uri string with your MongoDB deployment's connection string
76const uri = "<connection string uri>" ;
87
9- // Create a new client and connect to MongoDB
108const client = new MongoClient ( uri ) ;
119
1210async function run ( ) {
@@ -21,7 +19,7 @@ async function run() {
2119 // Print the number of deleted documents
2220 console . log ( "Deleted " + result . deletedCount + " documents" ) ;
2321 } finally {
24- // Close the client after the operation completes
22+ // Close the connection after the operation completes
2523 await client . close ( ) ;
2624 }
2725}
You can’t perform that action at this time.
0 commit comments