File tree Expand file tree Collapse file tree 17 files changed +71
-78
lines changed
code-snippets/usage-examples Expand file tree Collapse file tree 17 files changed +71
-78
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11const { MongoClient } = require ( "mongodb" ) ;
22const fs = require ( "fs" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
@@ -40,7 +40,7 @@ async function run() {
4040 console . log ( "Number of documents inserted: " + result . nInserted ) ;
4141 } else {
4242 console . log (
43- "No documents were inserted during the bulk write operation"
43+ "No documents were inserted during the bulk write operation" ,
4444 ) ;
4545 }
4646
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
Original file line number Diff line number Diff line change 11// ignored first line
22const { MongoClient } = require ( "mongodb" ) ;
33
4- // Replace the following string with your MongoDB deployment's connection string.
4+ // Replace the uri string with your MongoDB deployment's connection string.
55const uri =
6- "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority" ;
6+ "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority&useUnifiedTopology=true " ;
77
8- const client = new MongoClient ( uri , { useUnifiedTopology : true } ) ;
8+ const client = new MongoClient ( uri ) ;
99
1010async function run ( ) {
1111 try {
You can’t perform that action at this time.
0 commit comments