-
Notifications
You must be signed in to change notification settings - Fork 34
DOCSP-43396: Cleanup #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-43396: Cleanup #151
Changes from 15 commits
491a06a
809b539
785262a
c654e6b
235a448
be667e6
ef69038
1b87a90
6ea7b82
4de73cd
4d73c43
e7b3bd2
114801e
cea8e3c
0175012
d0f5a1e
ed486c7
b764364
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
// Replace the placeholder with your Atlas connection string | ||
$uri = "<connection string>"; | ||
$uri = '<connection string>'; | ||
|
||
// Create a MongoDB client with server API options | ||
$client = new MongoDB\Client($uri, [], [ | ||
|
@@ -14,6 +14,5 @@ | |
$result = $admin->command($command)->toArray(); | ||
|
||
echo json_encode($result), "\n"; | ||
echo "Pinged your deployment. You successfully connected to MongoDB!\n"; | ||
echo 'Pinged your deployment. You successfully connected to MongoDB!\n'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. S: should we replace all \n chars with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure I can do that |
||
|
||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
$uri = "mongodb://<hostname>:<port>"; | ||
$uri = 'mongodb://<hostname>:<port>'; | ||
|
||
$uriOptions = [ | ||
'tls' => true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
$uri = "mongodb://<hostname>:<port>"; | ||
$uri = 'mongodb://<hostname>:<port>'; | ||
|
||
$uriOptions = [ | ||
'tls' => true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
|
||
// Replace the placeholders with your actual hostname and port | ||
$uri = "mongodb://<hostname>:<port>/?directConnection=true"; | ||
$uri = 'mongodb://<hostname>:<port>/?directConnection=true'; | ||
|
||
// Create a MongoDB client | ||
$client = new MongoDB\Client($uri); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
$uri = "mongodb://host1:27017/?replicaSet=sampleRS"; | ||
$uri = 'mongodb://host1:27017/?replicaSet=sampleRS'; | ||
|
||
// Create a MongoDB client | ||
$client = new MongoDB\Client($uri); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,7 +4,10 @@ | |||||
|
||||||
use MongoDB\Client; | ||||||
|
||||||
$client = new Client('<connection string>'); | ||||||
$uri = getenv('MONGODB_URI') ?: throw new RuntimeException( | ||||||
'Set the MONGODB_URI environment variable to your Atlas URI' | ||||||
); | ||||||
$client = new MongoDB\Client($uri); | ||||||
$collection = $client->sample_mflix->movies; | ||||||
|
||||||
$filter = ['title' => 'The Shawshank Redemption']; | ||||||
|
@@ -13,5 +16,5 @@ | |||||
if ($result) { | ||||||
echo json_encode($result, JSON_PRETTY_PRINT); | ||||||
} else { | ||||||
echo "Document not found"; | ||||||
echo "Document not found'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: I might have suggested removing this in the past, but I think it is actually good to have in here, even as a repeat. There are some sharedincludes that we might use that might use this source constant. Maybe you can just do this:
driver-short = "{+library-short+}"