Skip to content

Commit 1274cc6

Browse files
authored
DOCSP-43396: Cleanup (#151)
* DOCSP-43396: Cleanup * quickstart fix * code fixes * edit * snooty * edit * code output * build log errors * another build fix * add info * upgrade guide to landing * fix * driver mentions * RR feedback * build fix
1 parent cf2b492 commit 1274cc6

File tree

81 files changed

+239
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+239
-202
lines changed

snooty.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ php-library = "MongoDB PHP Library"
3939

4040
[constants]
4141
php-library = "MongoDB PHP Library"
42-
driver-short = "PHP library"
4342
extension-short = "PHP extension"
4443
mdb-server = "MongoDB Server"
4544
stable-api = "Stable API"
4645
library-short = "PHP library"
46+
driver-short = "{+library-short+}"
4747
api = "https://www.mongodb.com/docs/php-library/current/reference"
4848
php-manual = "https://www.php.net/manual/en"
4949
string-data-type = "``string``"

source/aggregation.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,5 @@ API Documentation
201201
To learn more about the methods discussed in this guide, see the
202202
following API documentation:
203203

204-
- `MongoDB\\Collection::aggregate() <{+api+}/method/MongoDBCollection-aggregate/>`__
205-
- `MongoDB\\Collection::explain() <{+api+}/method/MongoDBCollection-explain/>`__
204+
- :phpmethod:`MongoDB\Collection::aggregate()`
205+
- :phpmethod:`MongoDB\Collection::explain()`

source/connect/client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ API Documentation
102102
To learn more about creating a ``MongoDB\Client`` object in the {+library-short+},
103103
see the following API documentation:
104104

105-
- :ref:`MongoDB\Client <php-api-mongodbclient>`
105+
- :phpclass:`MongoDB\Client`

source/connect/connection-options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ entry in the {+mdb-server+} manual.
8989
To learn more, see the following resources:
9090

9191
- `RFC 3986 <http://www.faqs.org/rfcs/rfc3986.html>`__
92-
- `rawurlencode <{+php-manual+}/rawurlencode>`__ in the PHP manual
92+
- :php:`rawurlencode <rawurlencode>` in the PHP manual
9393

9494
Replica Set Options
9595
~~~~~~~~~~~~~~~~~~~

source/connect/connection-targets.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ API Documentation
113113
To learn more about using the ``MongoDB\Client`` class,
114114
see the following API documentation:
115115

116-
- :ref:`MongoDB\Client <php-api-mongodbclient>`
116+
- :phpclass:`MongoDB\Client`

source/connect/stable-api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The following code example shows how you can use these parameters when construct
108108
API Documentation
109109
-----------------
110110

111-
For more information about the ``MongoDB\Client`` class, see the following {+driver-short+}
111+
For more information about the ``MongoDB\Client`` class, see the following {+library-short+}
112112
API documentation:
113113

114114
- :phpclass:`MongoDB\Client`

source/databases-collections.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ the ``test_database`` database:
6666

6767
To learn more about ``__get()`` and PHP magic methods, see the following resources:
6868

69-
- :phpmethod:`MongoDB\Client::__get()` in the API documentation
70-
- `Magic Methods <{+php-manual+}/language.oop5.magic.php>`__ in the PHP manual
69+
- :phpmethod:`MongoDB\Client::__get()` in the library API documentation
70+
- :php:`Magic Methods <language.oop5.magic>` in the PHP manual
7171

7272
.. _php-db-coll-access-collection:
7373

source/get-started/connect-to-mongodb.txt

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,26 @@ the Atlas sample datasets.
2929

3030
.. step:: Assign the connection string
3131

32-
Replace the ``<connection string>`` placeholder with the
33-
connection string that you copied from the :ref:`php-connection-string`
34-
step of this guide.
32+
Assign the ``MONGODB_URI`` environment variable to the connection string that you copied
33+
from the :ref:`php-connection-string` step of this guide. You can assign this
34+
variable by running a shell command or creating a ``.env`` file in your application,
35+
as show in the following tabs:
36+
37+
.. tabs::
38+
39+
.. tab:: Shell Command
40+
:tabid: shell
41+
42+
.. code-block:: sh
43+
44+
export MONGODB_URI=<connection string>
45+
46+
.. tab:: .env File
47+
:tabid: dotenv
48+
49+
.. code-block:: none
50+
51+
MONGODB_URI=<connection string>
3552

3653
.. step:: Run your PHP application
3754

@@ -58,9 +75,9 @@ the Atlas sample datasets.
5875
...
5976
}
6077

61-
If you encounter an error or see no output, ensure that you specified the
62-
proper connection string in the ``quickstart.php`` file and that you loaded the
63-
sample data.
78+
If you encounter an error or see no output, ensure that you assigned the
79+
proper connection string to the ``MONGODB_URI`` environment variable and
80+
that you loaded the sample data.
6481

6582
After you complete these steps, you have a PHP application that
6683
connects to your MongoDB deployment, runs a query on the sample

source/get-started/next-steps.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ In this tutorial, you created a PHP application that
1717
connects to a MongoDB deployment hosted on MongoDB Atlas
1818
and retrieves a document that matches a query.
1919

20-
.. TODO:
21-
Learn more about the {+php-library+} from the following resources:
22-
- Learn how to perform read operations in the :ref:`<php-read>` section.
23-
- Learn how to perform write operations in the :ref:`<php-write>` section.
20+
21+
Learn more about the {+php-library+} from the following resources:
22+
23+
- Learn how to perform read operations in the :ref:`<php-read>` section.
24+
- Learn how to perform write operations in the :ref:`<php-write>` section.

source/includes/aggregation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
$cursor = $collection->aggregate($pipeline);
1818

1919
foreach ($cursor as $doc) {
20-
echo json_encode($doc) , PHP_EOL;
20+
echo json_encode($doc), PHP_EOL;
2121
}
2222
// end-match-group
2323

@@ -35,6 +35,6 @@
3535
);
3636

3737
$result = $collection->explain($aggregate);
38-
echo json_encode($result) , PHP_EOL;
38+
echo json_encode($result), PHP_EOL;
3939
// end-explain
4040

0 commit comments

Comments
 (0)