Skip to content

Commit 85be2f0

Browse files
authored
Update deleteMany.ts
1 parent 07c5117 commit 85be2f0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

source/code-snippets/usage-examples/deleteMany.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Delete multiple documents
22

3-
// Import the MongoClient type from the mongodb package
43
import { MongoClient } from "mongodb";
54

65
// Replace the uri string with your MongoDB deployment's connection string
76
const uri = "<connection string uri>";
87

9-
// Create a new client and connect to MongoDB
108
const client = new MongoClient(uri);
119

1210
async 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
}

0 commit comments

Comments
 (0)