Skip to content

Commit 6101f20

Browse files
committed
JM feedback
1 parent e030a77 commit 6101f20

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

source/includes/usage-examples/connect-sample-app.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
// End example code here
88

9-
$admin = $client->admin;
10-
$result = $admin->command(['ping' => 1]);
11-
12-
if ($result) {
9+
try {
10+
$client->test->command(['ping' => 1]);
1311
echo 'Successfully pinged the MongoDB server.', PHP_EOL;
14-
} else {
15-
echo 'Ping to MongoDB server failed.', PHP_EOL;
12+
} catch (MongoDB\Driver\Exception\RuntimeException $e) {
13+
printf("Failed to ping the MongoDB server: %s\n", $e->getMessage());
1614
}

source/security.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ The following sections show how to connect to MongoDB by using the ``MONGODB-AWS
146146
authentication mechanism. When you use the ``MONGODB-AWS`` mechanism, the {+php-library+}
147147
attempts to retrieve your AWS credentials from the following sources, in the order listed:
148148

149-
1. Options parameter passed to the ``MongoDB\Client`` constructor or parameters in the
150-
connection URI
149+
1. Options passed to the ``MongoDB\Client`` constructor, either as part of the connection
150+
string or the ``$uriOptions`` array parameter
151151
#. Environment variables
152152
#. AWS EKS ``AssumeRoleWithWebIdentity`` request
153153
#. ECS container metadata

0 commit comments

Comments
 (0)