diff --git a/config/redirects b/config/redirects index 4989d297..62e3c9df 100644 --- a/config/redirects +++ b/config/redirects @@ -59,4 +59,37 @@ raw: ${prefix}/stable -> ${base}/current/ [*-v1.19]: ${prefix}/${version}/tutorial/example-data/ -> ${base}/v1.x/ [*-v1.19]: ${prefix}/${version}/tutorial/modeling-bson-data/ -> ${base}/v1.x/data-formats/modeling-bson-data/ [*-v1.19]: ${prefix}/${version}/tutorial/stable-api/ -> ${base}/v1.x/stable-api/ -[*-v1.19]: ${prefix}/${version}/tutorial/aws-lambda/ -> ${base}/v1.x/aws-lambda/ \ No newline at end of file +[*-v1.19]: ${prefix}/${version}/tutorial/aws-lambda/ -> ${base}/v1.x/aws-lambda/ + +# comprehensive coverage redirects +[*-master]: ${prefix}/${version}/aggregation/atlas-search/ -> ${base}/${version}/atlas-search/ +[*-master]: ${prefix}/${version}/aws-lambda/ -> ${base}/${version}/connect/aws-lambda/ +[*-master]: ${prefix}/${version}/connect/stable-api/ -> ${base}/${version}/connect/connection-options/stable-api/ +[*-master]: ${prefix}/${version}/builders/ -> ${base}/${version}/crud/builders/ +[*-master]: ${prefix}/${version}/write/bulk-write/ -> ${base}/${version}/crud/bulk-write/ +[*-master]: ${prefix}/${version}/write/delete/ -> ${base}/${version}/crud/delete/ +[*-master]: ${prefix}/${version}/write/gridfs/ -> ${base}/${version}/crud/gridfs/ +[*-master]: ${prefix}/${version}/write/insert/ -> ${base}/${version}/crud/insert/ +[*-master]: ${prefix}/${version}/read/count/ -> ${base}/${version}/crud/query/count/ +[*-master]: ${prefix}/${version}/read/cursor/ -> ${base}/${version}/crud/query/cursor/ +[*-master]: ${prefix}/${version}/read/distinct/ -> ${base}/${version}/crud/query/distinct/ +[*-master]: ${prefix}/${version}/read/project/ -> ${base}/${version}/crud/query/project/ +[*-master]: ${prefix}/${version}/read/retrieve/ -> ${base}/${version}/crud/query/retrieve/ +[*-master]: ${prefix}/${version}/read/specify-a-query/ -> ${base}/${version}/crud/query/specify-a-query/ +[*-master]: ${prefix}/${version}/read/specify-documents-to-return/ -> ${base}/${version}/crud/query/specify-documents-to-return/ +[*-master]: ${prefix}/${version}/read-write-pref/ -> ${base}/${version}/crud/read-write-pref/ +[*-master]: ${prefix}/${version}/write/replace/ -> ${base}/${version}/crud/replace/ +[*-master]: ${prefix}/${version}/write/transaction/ -> ${base}/${version}/crud/transaction/ +[*-master]: ${prefix}/${version}/write/update/ -> ${base}/${version}/crud/update/ +[*-master]: ${prefix}/${version}/data-formats/codecs/ -> ${base}/${version}/data-formats/custom-types/codecs/ +[*-master]: ${prefix}/${version}/databases-collections/time-series/ -> ${base}/${version}/data-formats/time-series/ +[*-master]: ${prefix}/${version}/read/change-streams/ -> ${base}/${version}/monitoring-logging/change-streams/ +[*-master]: ${prefix}/${version}/monitoring/cluster-monitoring/ -> ${base}/${version}/monitoring-logging/cluster-monitoring/ +[*-master]: ${prefix}/${version}/compatibility/ -> ${base}/${version}/references/compatibility/ +[*-master]: ${prefix}/${version}/whats-new/ -> ${base}/${version}/references/release-notes/ +[*-master]: ${prefix}/${version}/upgrade/ -> ${base}/${version}/references/upgrade/ +[*-master]: ${prefix}/${version}/connect/tls/ -> ${base}/${version}/security/tls/ +[*-master]: ${prefix}/${version}/aggregation/vector-search/ -> ${base}/${version}/vector-search/ +[*-master]: ${prefix}/${version}/monitoring/ -> ${base}/${version}/monitoring-logging/ +[*-master]: ${prefix}/${version}/read/ -> ${base}/${version}/crud/ +[*-master]: ${prefix}/${version}/write/ -> ${base}/${version}/crud/ \ No newline at end of file diff --git a/snooty.toml b/snooty.toml index 0d6dfcc0..8fe30017 100644 --- a/snooty.toml +++ b/snooty.toml @@ -21,14 +21,13 @@ toc_landing_pages = [ "/reference/class/MongoDBModelDatabaseInfo", "/reference/class/MongoDBModelIndexInfo", "/connect", - "/read", - "/databases-collections", - "/write", + "/connect/connection-options/", + "/aggregation", + "/data-formats", + "/data-formats/custom-types", "/indexes", "/security", - "/data-formats", "/upgrade", - "/aggregation", ] sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" diff --git a/source/aggregation.txt b/source/aggregation.txt index 04506307..9e3173f3 100644 --- a/source/aggregation.txt +++ b/source/aggregation.txt @@ -18,13 +18,6 @@ Transform Your Data with Aggregation :depth: 2 :class: singlecol -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Atlas Search - Atlas Vector Search - Overview -------- diff --git a/source/aggregation/atlas-search.txt b/source/atlas-search.txt similarity index 100% rename from source/aggregation/atlas-search.txt rename to source/atlas-search.txt diff --git a/source/connect.txt b/source/connect.txt index d45f506b..6db0b4fe 100644 --- a/source/connect.txt +++ b/source/connect.txt @@ -23,10 +23,12 @@ Connect to MongoDB :maxdepth: 1 Create a Client - Specify Connection Options Choose a Connection Target - Configure TLS - Stable API + Connection Options + Connect with AWS Lambda + +.. TODO: + Connection Troubleshooting Overview -------- diff --git a/source/aws-lambda.txt b/source/connect/aws-lambda.txt similarity index 100% rename from source/aws-lambda.txt rename to source/connect/aws-lambda.txt diff --git a/source/connect/connection-options.txt b/source/connect/connection-options.txt index 8f123f94..2a20d0a8 100644 --- a/source/connect/connection-options.txt +++ b/source/connect/connection-options.txt @@ -17,6 +17,14 @@ Specify Connection Options .. meta:: :keywords: connection string, URI, server, Atlas, settings, configure +.. toctree:: + + Stable API + +.. TODO: + Compress Network Traffic + Connection Pools + Overview -------- diff --git a/source/connect/stable-api.txt b/source/connect/connection-options/stable-api.txt similarity index 100% rename from source/connect/stable-api.txt rename to source/connect/connection-options/stable-api.txt diff --git a/source/crud.txt b/source/crud.txt new file mode 100644 index 00000000..1d9f54f6 --- /dev/null +++ b/source/crud.txt @@ -0,0 +1,49 @@ +.. _php-crud-operations: + +=============== +CRUD Operations +=============== + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :description: Learn how to use the {+library-short+} to read and write MongoDB data. + :keywords: usage examples, query, find, code example, save, create + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + Insert Documents + Query Documents + Update Documents + Replace Documents + Delete Documents + Bulk Write Operations + Transactions + Configure CRUD Operations + Store Large Files + Operations with Builders + +CRUD (Create, Read, Update, Delete) operations enable you to work with +data stored in MongoDB. To learn more about running CRUD operations on +your data, visit the following guides: + +- :ref:`php-write-insert` +- :ref:`php-query` +- :ref:`php-write-update` +- :ref:`php-write-replace` +- :ref:`php-write-delete` +- :ref:`php-bulk-write` +- :ref:`php-transactions` +- :ref:`php-read-write-pref` +- :ref:`php-gridfs` +- :ref:`php-builders` \ No newline at end of file diff --git a/source/builders.txt b/source/crud/builders.txt similarity index 100% rename from source/builders.txt rename to source/crud/builders.txt diff --git a/source/write/bulk-write.txt b/source/crud/bulk-write.txt similarity index 99% rename from source/write/bulk-write.txt rename to source/crud/bulk-write.txt index bf9abcec..e0ade569 100644 --- a/source/write/bulk-write.txt +++ b/source/crud/bulk-write.txt @@ -68,7 +68,7 @@ specify the write operations: .. tip:: For more information about delete, insert, replace, and update - operations, see the :ref:`Write operation guides `. + operations, see the :ref:`php-crud-operations` guides. When you call the ``bulkWrite()`` method, the library automatically runs the write operations in the order they're specified in the array. To learn how to diff --git a/source/write/delete.txt b/source/crud/delete.txt similarity index 100% rename from source/write/delete.txt rename to source/crud/delete.txt diff --git a/source/write/gridfs.txt b/source/crud/gridfs.txt similarity index 100% rename from source/write/gridfs.txt rename to source/crud/gridfs.txt diff --git a/source/write/insert.txt b/source/crud/insert.txt similarity index 98% rename from source/write/insert.txt rename to source/crud/insert.txt index 1a32d551..9885713b 100644 --- a/source/write/insert.txt +++ b/source/crud/insert.txt @@ -158,9 +158,6 @@ insert operation bypasses document-level validation: Additional Information ---------------------- -To view runnable code examples of inserting documents with the {+php-library+}, see -:ref:`php-write`. - API Documentation ~~~~~~~~~~~~~~~~~ diff --git a/source/crud/query.txt b/source/crud/query.txt new file mode 100644 index 00000000..bfa334ba --- /dev/null +++ b/source/crud/query.txt @@ -0,0 +1,37 @@ +.. _php-query: + +================ +Query Operations +================ + +.. meta:: + :description: Learn how to use the {+library-short+} to read data from MongoDB. + :keywords: usage examples, query, find, code example + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: code example, node.js, sample dataset + +.. toctree:: + :maxdepth: 1 + + Find Documents + Specify Documents to Return + Specify Fields to Return + Specify a Query + Count Documents + Distinct Field Values + Access Data from a Cursor + +To learn more about querying data stored in MongoDB collections, +visit the following guides: + +- :ref:`php-retrieve` +- :ref:`php-specify-documents-to-return` +- :ref:`php-project` +- :ref:`php-count` +- :ref:`php-distinct` +- :ref:`php-cursors` \ No newline at end of file diff --git a/source/read/count.txt b/source/crud/query/count.txt similarity index 100% rename from source/read/count.txt rename to source/crud/query/count.txt diff --git a/source/read/cursor.txt b/source/crud/query/cursor.txt similarity index 100% rename from source/read/cursor.txt rename to source/crud/query/cursor.txt diff --git a/source/read/distinct.txt b/source/crud/query/distinct.txt similarity index 100% rename from source/read/distinct.txt rename to source/crud/query/distinct.txt diff --git a/source/read/project.txt b/source/crud/query/project.txt similarity index 100% rename from source/read/project.txt rename to source/crud/query/project.txt diff --git a/source/read/retrieve.txt b/source/crud/query/retrieve.txt similarity index 98% rename from source/read/retrieve.txt rename to source/crud/query/retrieve.txt index b00691a3..4e76dff1 100644 --- a/source/read/retrieve.txt +++ b/source/crud/query/retrieve.txt @@ -240,9 +240,6 @@ Additional Information To learn more about query filters, see the :ref:`php-specify-query` guide. -To view code examples of retrieving documents with the {+php-library+}, -see :ref:`php-read`. - API Documentation ~~~~~~~~~~~~~~~~~ diff --git a/source/read/specify-a-query.txt b/source/crud/query/specify-a-query.txt similarity index 100% rename from source/read/specify-a-query.txt rename to source/crud/query/specify-a-query.txt diff --git a/source/read/specify-documents-to-return.txt b/source/crud/query/specify-documents-to-return.txt similarity index 100% rename from source/read/specify-documents-to-return.txt rename to source/crud/query/specify-documents-to-return.txt diff --git a/source/read-write-pref.txt b/source/crud/read-write-pref.txt similarity index 100% rename from source/read-write-pref.txt rename to source/crud/read-write-pref.txt diff --git a/source/write/replace.txt b/source/crud/replace.txt similarity index 100% rename from source/write/replace.txt rename to source/crud/replace.txt diff --git a/source/write/transaction.txt b/source/crud/transaction.txt similarity index 99% rename from source/write/transaction.txt rename to source/crud/transaction.txt index 5a929cc0..d74356f2 100644 --- a/source/write/transaction.txt +++ b/source/crud/transaction.txt @@ -163,6 +163,8 @@ completes the following actions: .. sharedinclude:: dbx/transactions-parallelism.rst + .. replacement:: driver-specific-content + Additional Information ---------------------- diff --git a/source/write/update.txt b/source/crud/update.txt similarity index 100% rename from source/write/update.txt rename to source/crud/update.txt diff --git a/source/data-formats.txt b/source/data-formats.txt index 550c2d64..99c495af 100644 --- a/source/data-formats.txt +++ b/source/data-formats.txt @@ -22,9 +22,9 @@ Specialized Data Formats :maxdepth: 1 Custom Data Types - Codecs Decimal128 BSON + Time Series Overview -------- @@ -34,6 +34,6 @@ application. To learn how to work with these data formats, see the following guides: - :ref:`php-custom-types` -- :ref:`php-codecs` - :ref:`php-decimal128` -- :ref:`php-bson` \ No newline at end of file +- :ref:`php-bson` +- :ref:`php-time-series` \ No newline at end of file diff --git a/source/data-formats/custom-types.txt b/source/data-formats/custom-types.txt index c1283312..caf0af94 100644 --- a/source/data-formats/custom-types.txt +++ b/source/data-formats/custom-types.txt @@ -4,6 +4,16 @@ Custom Data-Types ================= +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. toctree:: + :maxdepth: 1 + + Codecs .. note:: diff --git a/source/data-formats/codecs.txt b/source/data-formats/custom-types/codecs.txt similarity index 99% rename from source/data-formats/codecs.txt rename to source/data-formats/custom-types/codecs.txt index b817eeb9..3788ad41 100644 --- a/source/data-formats/codecs.txt +++ b/source/data-formats/custom-types/codecs.txt @@ -4,7 +4,6 @@ Codecs ====== - .. contents:: On this page :local: :backlinks: none diff --git a/source/databases-collections/time-series.txt b/source/data-formats/time-series.txt similarity index 98% rename from source/databases-collections/time-series.txt rename to source/data-formats/time-series.txt index 9c21e2e3..10d1c726 100644 --- a/source/databases-collections/time-series.txt +++ b/source/data-formats/time-series.txt @@ -196,7 +196,7 @@ following Server manual entries: - :manual:`Create and Query a Time Series Collection ` - :manual:`Set Granularity for Time Series Data ` -To learn more about performing read operations, see :ref:`php-read`. +To learn more about performing query operations, see :ref:`php-query`. To learn more about performing aggregation operations, see the :ref:`php-aggregation` guide. diff --git a/source/databases-collections.txt b/source/databases-collections.txt index 833a85b9..ff6442b4 100644 --- a/source/databases-collections.txt +++ b/source/databases-collections.txt @@ -17,12 +17,6 @@ Databases and Collections .. meta:: :keywords: table, row, organize, storage, code example -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Time Series - Overview -------- diff --git a/source/get-started.txt b/source/get-started.txt index 45d7a3b3..007cbeb8 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -344,5 +344,5 @@ and retrieves a document that matches a query. Learn more about the {+php-library+} from the following resources: -- Learn how to perform read operations in the :ref:`` section. -- Learn how to perform write operations in the :ref:`` section. \ No newline at end of file +- Learn how to configure your MongoDB connection in the :ref:`php-connect` section. +- Learn how to perform read and write operations in the :ref:`php-crud-operations` section. \ No newline at end of file diff --git a/source/includes/extracts-bucket-option.yaml b/source/includes/extracts-bucket-option.yaml index 1ca8a553..e0a92e68 100644 --- a/source/includes/extracts-bucket-option.yaml +++ b/source/includes/extracts-bucket-option.yaml @@ -1,6 +1,6 @@ ref: bucket-option-codec content: | - The :doc:`codec ` to use for encoding or decoding documents. + The :ref:`php-codecs` to use for encoding or decoding documents. This option is mutually exclusive with the ``typeMap`` option. Defaults to the bucket's codec. Inheritance for a default ``codec`` option diff --git a/source/includes/extracts-collection-option.yaml b/source/includes/extracts-collection-option.yaml index c293dc62..0ae5d0d0 100644 --- a/source/includes/extracts-collection-option.yaml +++ b/source/includes/extracts-collection-option.yaml @@ -1,6 +1,6 @@ ref: collection-option-codec content: | - The :doc:`codec ` to use for encoding or decoding documents. + The :ref:`php-codecs` to use for encoding or decoding documents. This option is mutually exclusive with the ``typeMap`` option. Defaults to the collection's codec. Inheritance for a default ``codec`` option diff --git a/source/includes/extracts-common-option.yaml b/source/includes/extracts-common-option.yaml index 68702d6e..11c6a27c 100644 --- a/source/includes/extracts-common-option.yaml +++ b/source/includes/extracts-common-option.yaml @@ -1,6 +1,6 @@ ref: common-option-codec content: | - The :doc:`codec ` to use for encoding or decoding documents. + The :ref:`php-codecs` to use for encoding or decoding documents. This option is mutually exclusive with the ``typeMap`` option. --- ref: common-option-collation diff --git a/source/index.txt b/source/index.txt index 53398b22..67848f53 100644 --- a/source/index.txt +++ b/source/index.txt @@ -14,24 +14,21 @@ MongoDB PHP Library :titlesonly: Get Started - Connect to MongoDB + Connect Databases & Collections - Read Data - Write Data - Operations with Builders - CRUD Operations & Replica Sets - Run a Database Command - Data Aggregation + CRUD Operations + Aggregation + Data Formats Indexes - Monitor Your Application + Run a Database Command + Atlas Search + Atlas Vector Search + Monitoring and Logging Security - Specialized Data Formats - Deploy to AWS Lambda - Compatibility - What's New - Upgrade + Reference FAQ API Documentation + Issues & Help Overview -------- @@ -65,50 +62,49 @@ Databases and Collections Learn how to use the {+library-short+} to work with MongoDB databases and collections in the :ref:`php-databases-collections` section. -Read Data ---------- +Read and Write Data +------------------- -Learn how you can retrieve data from MongoDB in the :ref:`php-read` section. +Learn how to find, update, and delete data in the :ref:`` section. -Write Data to MongoDB ---------------------- +Transform Your Data with Aggregation +------------------------------------ -Learn how you can write data to MongoDB in the :ref:`php-write` section. +Learn how to use the {+library-short+} to perform aggregation operations in the +:ref:`php-aggregation` section. -Operations with Builders ------------------------- +Data Formats +------------ -Learn how to use builder classes and factory methods to create queries -in the :ref:`php-builders` section. +Learn how to work with specialized data formats and custom types in the +:ref:`php-data-formats` section. -Specify How CRUD Operations Run on Replica Sets ------------------------------------------------ +Optimize Queries with Indexes +----------------------------- -Learn how to configure settings for read and write operations on replica -sets in the :ref:`php-read-write-pref` section. +Learn how to work with common types of indexes in the :ref:`php-indexes` +section. Run a Database Command ---------------------- Learn how to run a database command in the :ref:`php-run-command` section. -Transform Your Data with Aggregation ------------------------------------- +Atlas Search +------------ -Learn how to use the {+library-short+} to perform aggregation operations in the -:ref:`php-aggregation` section. +Learn how to run Atlas Search queries in the :ref:`` section. -Optimize Queries with Indexes ------------------------------ +Atlas Vector Search +------------------- -Learn how to work with common types of indexes in the :ref:`php-indexes` -section. +Learn how to run Atlas Vector Search queries in the :ref:`` section. -Monitoring ----------- +Monitoring and Logging +---------------------- -Learn how to monitor change events in the :ref:`php-monitoring` -section. +Learn how to monitor changes to your application and write them to logs in the +:ref:`` section. Secure Your Data ---------------- @@ -116,39 +112,20 @@ Secure Your Data Learn about ways you can authenticate your application and encrypt your data in the :ref:`php-security` section. -Specialized Data Formats ------------------------- - -Learn how to work with specialized data formats and custom types in the -:ref:`php-data-formats` section. - -Deploy to AWS Lambda --------------------- - -Learn how to deploy a PHP application on AWS Lambda by using Bref in the -:ref:`php-aws-lambda` section. - -Compatibility -------------- - -See compatibility tables showing the recommended {+library-short+} version to use for -specific PHP and {+mdb-server+} versions in the :ref:`php-compatibility` section. - -What's New ----------- - -Learn about new features and changes in each version in the :ref:`` -section. - +Reference +--------- -Upgrade Library Versions ------------------------- - -Learn what changes you must make to your application to upgrade library and -extension versions in the :ref:`php-upgrade` section. +Learn more about {+library-short+} versions, compatibility, and upgrade considerations in the +:ref:`Reference ` section. FAQ --- See answers to commonly asked questions about the {+library-short+} in the the :ref:`php-faq` section. + +Issues & Help +------------- + +Learn how to report bugs, contribute to the library, and find help in the +:ref:`Issues & Help ` section. diff --git a/source/issues-and-help.txt b/source/issues-and-help.txt new file mode 100644 index 00000000..ce6369c8 --- /dev/null +++ b/source/issues-and-help.txt @@ -0,0 +1,80 @@ +.. _php-issues-and-help: + +============= +Issues & Help +============= + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: php, troubleshooting, feedback + :description: Find support for the PHP library, report bugs or feature requests, and learn how to contribute. + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +We are lucky to have a vibrant MongoDB PHP community that includes users +with varying levels of experience using the {+library-short+}. The +quickest way to get support for general questions is through the +:community-forum:`MongoDB Community Forums `. + +Bugs / Feature Requests +----------------------- + +If you have feedback about the {+library-short+}, visit the `MongoDB +Feedback Engine `__ and select +:guilabel:`Drivers` from the list of products on the right side of +your screen. You can propose improvements, report issues, and provide +other types of feedback by using this site. + +You can also open a case in Jira, our issue management tool, to identify +bugs or propose improvements. The following steps describe how to create +a Jira issue: + +1. Visit the `MongoDB Jira issue tracker `__ and click the + `signup link. `__ + Create an account, and then log in to Jira. +#. Navigate to the `PHPLIB Jira project. `__ +#. Click :guilabel:`Create` to create a ticket. Please provide as much + information as possible about the issue or request in the ticket. + +.. note:: + + Bug reports in the PHPLIB Jira project are publicly viewable. + +If you've identified a security vulnerability in any official MongoDB +product, please report it according to the instructions found in the +:manual:`Create a Vulnerability Report page. ` + +Pull Requests +------------- + +We are happy to accept contributions to help improve the {+library-short+}. We guide +user contributions to ensure they meet the standards of the codebase. Ensure +that any pull requests include documentation, tests, and pass the +static analysis checks. + +To contribute to the library, check out the source and work on a branch: + +.. code-block:: bash + + git clone https://github.com/mongodb/mongo-php-library.git + cd mongo-php-library + composer update + git checkout -b myNewFeature + +Then, run the library's test suite by using the following command: + +.. code-block:: bash + + composer run test + +To learn more about the requirements for pull requests, see +:github:`Contributing to the PHP Library for MongoDB +` +on GitHub. diff --git a/source/monitoring-logging.txt b/source/monitoring-logging.txt new file mode 100644 index 00000000..5f5fc7b2 --- /dev/null +++ b/source/monitoring-logging.txt @@ -0,0 +1,18 @@ +.. _php-monitoring: +.. _php-monitoring-logging: + +====================== +Monitoring and Logging +====================== + +.. toctree:: + :caption: Monitoring categories + + Cluster Monitoring + Change Streams + +.. /monitoring/command-monitoring +.. /monitoring/connection-monitoring + +- :ref:`Cluster Monitoring `: Monitor changes + in your cluster configuration \ No newline at end of file diff --git a/source/read/change-streams.txt b/source/monitoring-logging/change-streams.txt similarity index 100% rename from source/read/change-streams.txt rename to source/monitoring-logging/change-streams.txt diff --git a/source/monitoring/cluster-monitoring.txt b/source/monitoring-logging/cluster-monitoring.txt similarity index 100% rename from source/monitoring/cluster-monitoring.txt rename to source/monitoring-logging/cluster-monitoring.txt diff --git a/source/monitoring.txt b/source/monitoring.txt deleted file mode 100644 index 43d15f27..00000000 --- a/source/monitoring.txt +++ /dev/null @@ -1,21 +0,0 @@ -.. _php-monitoring: - -======================== -Monitor Your Application -======================== - -.. toctree:: - :caption: Monitoring categories - - Cluster Monitoring - -.. /monitoring/command-monitoring -.. /monitoring/connection-monitoring - -- :ref:`Cluster Monitoring `: Monitor changes - in your cluster configuration - -.. TODO - :ref:`Command Monitoring `: monitor command -.. execution -.. - :ref:`Connection Pool Monitoring `: -.. monitor changes in the connection pool \ No newline at end of file diff --git a/source/read.txt b/source/read.txt deleted file mode 100644 index 10dc8d84..00000000 --- a/source/read.txt +++ /dev/null @@ -1,167 +0,0 @@ -.. _php-read: - -========= -Read Data -========= - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: reference - -.. meta:: - :description: Learn how to use the PHP Library to read data to MongoDB. - :keywords: usage examples, save, crud, read, code example - -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Retrieve Data - Specify Fields to Return - Access Data from a Cursor - Count Documents - Specify Documents to Return - Specify a Query - Distinct Field Values - Monitor Changes - -Overview --------- - -On this page, you can see copyable code examples that show common -{+library-short+} methods for retrieving documents. - -.. tip:: - - To learn more about any of the methods shown on this page, see the link - provided in each section. - -To use an example from this page, copy the code example into the -:ref:`sample application ` or your own application. -Make sure to set the ``MONGODB_URI`` environment variable to the -connection string for your MongoDB deployment, and replace the -```` and ```` placeholders with values for your -target namespace. - -.. _php-read-sample: - -.. include:: /includes/usage-examples/sample-app-intro.rst - -.. literalinclude:: /includes/usage-examples/sample-app.php - :language: php - :dedent: - :linenos: - :emphasize-lines: 10-12 - -Find One --------- - -The following code shows how to retrieve a single document from a collection -that matches the specified criteria: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-find-one - :end-before: end-find-one - :language: php - :dedent: - -To learn more about the ``findOne()`` method, see the :ref:`php-retrieve-find-one` -section in the Retrieve Data guide. - -.. _php-find-many-documents: - -Find Multiple -------------- - -The following code shows how to retrieve all documents from a collection -that match the specified criteria: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-find-multiple - :end-before: end-find-multiple - :language: php - :dedent: - -To learn more about the ``find()`` method, see the :ref:`php-retrieve-find-multiple` -section in the Retrieve Data guide. - -Count Documents in a Collection -------------------------------- - -The following code shows how to count the number of documents in -a collection: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-count - :end-before: end-count - :language: php - :dedent: - -To learn more about the ``countDocuments()`` method, see the -:ref:`php-count-all` section in the Count Documents guide. - -Count Documents Returned from a Query -------------------------------------- - -The following code shows how to count documents in a collection -that match the specified criteria: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-count-specific - :end-before: end-count-specific - :language: php - :dedent: - -To learn more about the ``countDocuments()`` method, see the -:ref:`php-count-specific` section in the Count Documents guide. - -Estimated Document Count ------------------------- - -The following code shows how to retrieve an estimated count of the -number of documents in a collection: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-count-estimate - :end-before: end-count-estimate - :language: php - :dedent: - -To learn more about the ``estimatedDocumentCount()`` method, see the -:ref:`php-estimated-count` section in the Count Documents guide. - -Retrieve Distinct Values ------------------------- - -The following code shows how to retrieve the unique values of a field -for documents that match the specified criteria: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-distinct - :end-before: end-distinct - :language: php - :dedent: - -To learn more about the ``distinct()`` method, see the -:ref:`php-distinct` guide. - -Monitor Data Changes --------------------- - -The following code shows how to monitor and print changes to a -collection: - -.. literalinclude:: /includes/usage-examples/read-code-examples.php - :start-after: start-change-stream - :end-before: end-change-stream - :language: php - :dedent: - -To learn more about the ``watch()`` method, see the -:ref:`php-change-streams` guide. diff --git a/source/reference/method/MongoDBClient-getCollection.txt b/source/reference/method/MongoDBClient-getCollection.txt index d6adb303..faefbf54 100644 --- a/source/reference/method/MongoDBClient-getCollection.txt +++ b/source/reference/method/MongoDBClient-getCollection.txt @@ -47,7 +47,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for collection + - The default :ref:`php-codecs` to use for collection operations. .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBClient-selectCollection.txt b/source/reference/method/MongoDBClient-selectCollection.txt index aa2fdb29..d5fe57f2 100644 --- a/source/reference/method/MongoDBClient-selectCollection.txt +++ b/source/reference/method/MongoDBClient-selectCollection.txt @@ -50,7 +50,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for collection + - The default :ref:`php-codecs` to use for collection operations. .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBCollection-bulkWrite.txt b/source/reference/method/MongoDBCollection-bulkWrite.txt index 4a85ab91..ac572c3b 100644 --- a/source/reference/method/MongoDBCollection-bulkWrite.txt +++ b/source/reference/method/MongoDBCollection-bulkWrite.txt @@ -148,7 +148,6 @@ See Also -------- - :ref:`php-bulk-write` -- :ref:`php-write` - :phpmethod:`MongoDB\Collection::deleteMany()` - :phpmethod:`MongoDB\Collection::deleteOne()` - :phpmethod:`MongoDB\Collection::insertMany()` diff --git a/source/reference/method/MongoDBCollection__construct.txt b/source/reference/method/MongoDBCollection__construct.txt index 35fdf3df..d532ec0f 100644 --- a/source/reference/method/MongoDBCollection__construct.txt +++ b/source/reference/method/MongoDBCollection__construct.txt @@ -60,7 +60,7 @@ Definition * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for collection + - The default :ref:`php-codecs` to use for collection operations. .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBDatabase-getCollection.txt b/source/reference/method/MongoDBDatabase-getCollection.txt index 1255c300..3dd2b813 100644 --- a/source/reference/method/MongoDBDatabase-getCollection.txt +++ b/source/reference/method/MongoDBDatabase-getCollection.txt @@ -43,7 +43,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for collection + - The default :ref:`php-codecs` to use for collection operations. .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBDatabase-selectCollection.txt b/source/reference/method/MongoDBDatabase-selectCollection.txt index f27fb8a7..9e7db979 100644 --- a/source/reference/method/MongoDBDatabase-selectCollection.txt +++ b/source/reference/method/MongoDBDatabase-selectCollection.txt @@ -43,7 +43,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for collection + - The default :ref:`php-codecs` to use for collection operations. .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt index 174c0d31..6b76b752 100644 --- a/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt +++ b/source/reference/method/MongoDBDatabase-selectGridFSBucket.txt @@ -48,7 +48,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for bucket methods + - The default :ref:`php-codecs` to use for bucket methods that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`). .. versionadded:: 1.17 diff --git a/source/reference/method/MongoDBGridFSBucket__construct.txt b/source/reference/method/MongoDBGridFSBucket__construct.txt index 3c9d429e..c0f2939c 100644 --- a/source/reference/method/MongoDBGridFSBucket__construct.txt +++ b/source/reference/method/MongoDBGridFSBucket__construct.txt @@ -56,7 +56,7 @@ Parameters * - codec - MongoDB\\Codec\\DocumentCodec - - The default :doc:`codec ` to use for bucket methods + - The default :ref:`php-codecs` to use for bucket methods that return a file document (e.g. :phpmethod:`MongoDB\GridFS\Bucket::find()`). .. versionadded:: 1.17 diff --git a/source/references.txt b/source/references.txt new file mode 100644 index 00000000..cc45e239 --- /dev/null +++ b/source/references.txt @@ -0,0 +1,20 @@ +.. _php-reference: + +========= +Reference +========= + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + Release Notes + Compatibility + Upgrade Guides + +To learn about the differences between versions of +the {+library-short+}, view the following guides: + +- :ref:`php-release-notes` +- :ref:`php-compatibility` +- :ref:`php-upgrade` \ No newline at end of file diff --git a/source/compatibility.txt b/source/references/compatibility.txt similarity index 100% rename from source/compatibility.txt rename to source/references/compatibility.txt diff --git a/source/whats-new.txt b/source/references/release-notes.txt similarity index 99% rename from source/whats-new.txt rename to source/references/release-notes.txt index ad60d98c..286f3991 100644 --- a/source/whats-new.txt +++ b/source/references/release-notes.txt @@ -1,8 +1,9 @@ .. _php-lib-whats-new: +.. _php-release-notes: -========== -What's New -========== +============= +Release Notes +============= .. facet:: :name: genre diff --git a/source/upgrade.txt b/source/references/upgrade.txt similarity index 100% rename from source/upgrade.txt rename to source/references/upgrade.txt diff --git a/source/security.txt b/source/security.txt index 249ae009..c300166c 100644 --- a/source/security.txt +++ b/source/security.txt @@ -24,6 +24,7 @@ Secure Your Data Authentication Encryption + TLS Overview -------- diff --git a/source/connect/tls.txt b/source/security/tls.txt similarity index 100% rename from source/connect/tls.txt rename to source/security/tls.txt diff --git a/source/aggregation/vector-search.txt b/source/vector-search.txt similarity index 100% rename from source/aggregation/vector-search.txt rename to source/vector-search.txt diff --git a/source/write.txt b/source/write.txt deleted file mode 100644 index 3114e42f..00000000 --- a/source/write.txt +++ /dev/null @@ -1,189 +0,0 @@ -.. _php-write: - -===================== -Write Data to MongoDB -===================== - -.. contents:: On this page - :local: - :backlinks: none - :depth: 2 - :class: singlecol - -.. facet:: - :name: genre - :values: reference - -.. meta:: - :description: Learn how to use the PHP Library to write data to MongoDB. - :keywords: usage examples, save, crud, create, code example - -.. toctree:: - :titlesonly: - :maxdepth: 1 - - Update - Insert - Delete - Replace - Bulk Write Operations - Transactions - Store Large Files - -Overview --------- - -On this page, you can see copyable code examples that show common -{+php-library+} methods for writing data to MongoDB. - -.. tip:: - - To learn more about any of the methods shown on this page, see the link - provided in each section. - -To use an example from this page, copy the code example into the -:ref:`sample application ` or your own application. -Make sure to set the ``MONGODB_URI`` environment variable to the -connection string for your MongoDB deployment, and replace the -```` and ```` placeholders with values for your -target namespace. - -.. _php-write-sample: - -.. include:: /includes/usage-examples/sample-app-intro.rst - -.. literalinclude:: /includes/usage-examples/sample-app.php - :language: php - :dedent: - :linenos: - :emphasize-lines: 10-12 - -Insert One ----------- - -The following code shows how to insert a single document into a collection: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-insert-one - :end-before: end-insert-one - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::insertOne()`` method, see the -:ref:`Insert Documents ` guide. - -Insert Multiple ---------------- - -The following code shows how to insert multiple documents into a collection: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-insert-multiple - :end-before: end-insert-multiple - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::insertMany()`` method, see the -:ref:`Insert Documents ` guide. - -Update One ----------- - -The following code shows how to update a single document in a collection by creating -or editing a field: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-update-one - :end-before: end-update-one - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::updateOne()`` method, see the -:ref:`Update Documents ` guide. - -Update Multiple ---------------- - -The following code shows how to update multiple documents in a collection by creating -or editing a field: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-update-multiple - :end-before: end-update-multiple - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::updateMany()`` method, see the -:ref:`Update Documents ` guide. - -Replace One ------------ - -The following code shows how to replace a single document in a collection -with another document: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-replace-one - :end-before: end-replace-one - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::replaceOne()`` method, see the -:ref:`Replace Documents ` guide. - -Delete One ----------- - -The following code shows how to delete a single document in a collection: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-delete-one - :end-before: end-delete-one - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::deleteOne()`` method, see the -:ref:`Delete Documents ` guide. - -Delete Multiple ---------------- - -The following code shows how to delete multiple documents in a collection: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-delete-multiple - :end-before: end-delete-multiple - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::deleteMany()`` method, see the -:ref:`Delete Documents ` guide. - -Bulk Write ----------- - -The following code shows how to perform multiple write operations in a single bulk -operation: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-bulk-write - :end-before: end-bulk-write - :language: php - :dedent: - -To learn more about the ``MongoDB\Collection::bulkWrite()`` method, see the -:ref:`Bulk Write ` guide. - -Store Large Files ------------------ - -The following code shows how to store files in a GridFS bucket by -creating an upload stream: - -.. literalinclude:: /includes/usage-examples/write-code-examples.php - :start-after: start-gridfs-upload - :end-before: end-gridfs-upload - :language: php - :dedent: - -To learn more about GridFS, see the :ref:`Store Large Files ` guide.