Skip to content

Commit

Permalink
feat: remove useNewUrlParser and useUnifiedTopology from export to la…
Browse files Browse the repository at this point in the history
…nguage COMPASS-4897 (#4837)

* feat: remove useNewUrlParser and useUnifiedTopology COMPASS-4897

* fix spaces
  • Loading branch information
mcasimir authored Oct 3, 2023
1 parent 264fe1f commit 8d10dea
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/bson-transpilers/symbols/javascript/templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ Templates:
}
return `${comment}\n\n${defs}
const client = await MongoClient.connect(
'${spec.options.uri}',
{ useNewUrlParser: true, useUnifiedTopology: true }
'${spec.options.uri}'
);
const coll = client.db('${spec.options.database}').collection('${spec.options.collection}');
${cmd}
Expand Down
9 changes: 3 additions & 6 deletions packages/bson-transpilers/test/yaml/driver-syntax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ tests:
};
const client = await MongoClient.connect(
'mongodb://localhost:27017',
{ useNewUrlParser: true, useUnifiedTopology: true }
'mongodb://localhost:27017'
);
const coll = client.db('db').collection('collection');
const cursor = coll.aggregate(agg);
Expand Down Expand Up @@ -211,8 +210,7 @@ tests:
};
const client = await MongoClient.connect(
'mongodb://localhost:27017',
{ useNewUrlParser: true, useUnifiedTopology: true }
'mongodb://localhost:27017'
);
const coll = client.db('db').collection('collection');
const cursor = coll.find(filter);
Expand Down Expand Up @@ -425,8 +423,7 @@ tests:
};
const client = await MongoClient.connect(
'mongodb://localhost:27017',
{ useNewUrlParser: true, useUnifiedTopology: true }
'mongodb://localhost:27017'
);
const coll = client.db('db').collection('collection');
const cursor = coll.find(filter, { projection, sort, skip, limit, maxTimeMS, collation });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ const filter = {
};
const client = await MongoClient.connect(
'mongodb://foo:[email protected]',
{ useNewUrlParser: true, useUnifiedTopology: true }
'mongodb://foo:[email protected]'
);
const coll = client.db('namespace').collection('');
const cursor = coll.find(filter);
Expand Down Expand Up @@ -215,8 +214,7 @@ const filter = {
};
const client = await MongoClient.connect(
'${uri}',
{ useNewUrlParser: true, useUnifiedTopology: true }
'${uri}'
);
const coll = client.db('namespace').collection('');
const cursor = coll.find(filter);
Expand Down

0 comments on commit 8d10dea

Please sign in to comment.