Skip to content

Commit 62aa2ff

Browse files
authored
DOCSP-32718: stableapi options code comments (#761)
* DOCSP-32718: stableapi options code comments * fixes
1 parent 62d7152 commit 62aa2ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/code-snippets/stable-api/options.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
// Stable API - with options
2+
13
// begin serverApiVersion
24
const { MongoClient, ServerApiVersion } = require("mongodb");
35

6+
// Replace the placeholders in the connection string uri with your credentials
47
const uri = "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
8+
9+
/* Create a client with options to specify Stable API Version 1, return
10+
errors for commands outside of the API version, and raise exceptions
11+
for deprecated commands */
512
const client = new MongoClient(uri,
613
{
714
serverApi: {

0 commit comments

Comments
 (0)