We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aa8770 commit 11239b7Copy full SHA for 11239b7
source/code-snippets/stable-api/options.js
@@ -1,7 +1,14 @@
1
+// Stable API - with options
2
+
3
// begin serverApiVersion
4
const { MongoClient, ServerApiVersion } = require("mongodb");
5
6
+// Replace the placeholders in the connection string uri with your credentials
7
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 */
12
const client = new MongoClient(uri,
13
{
14
serverApi: {
0 commit comments