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 ( ) {
@@ -22,7 +20,7 @@ async function run() {
2220 // Print the number of deleted documents
2321 console . log ( "Deleted " + result . deletedCount + " documents" ) ;
2422 } finally {
25- // Close the client after the operation completes
23+ // Close the connection after the operation completes
2624 await client . close ( ) ;
2725 }
2826}
You can’t perform that action at this time.
0 commit comments