From 4d4ac34f4a12577eec70df5f52d27a13e5fb3b43 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Thu, 12 Sep 2024 08:17:57 -0700 Subject: [PATCH 1/6] get started first pages --- snooty.toml | 15 +- source/get-started.txt | 48 +++++ source/get-started/connect-to-mongodb.txt | 5 + .../create-a-connection-string.txt | 5 + source/get-started/create-a-deployment.txt | 5 + source/get-started/download-and-install.txt | 202 ++++++++++++++++++ source/get-started/next-steps.txt | 5 + source/includes/get-started/troubleshoot.rst | 6 + source/index.txt | 10 +- 9 files changed, 289 insertions(+), 12 deletions(-) create mode 100644 source/get-started.txt create mode 100644 source/get-started/connect-to-mongodb.txt create mode 100644 source/get-started/create-a-connection-string.txt create mode 100644 source/get-started/create-a-deployment.txt create mode 100644 source/get-started/download-and-install.txt create mode 100644 source/get-started/next-steps.txt create mode 100644 source/includes/get-started/troubleshoot.rst diff --git a/snooty.toml b/snooty.toml index 17aedb31..f3733b96 100644 --- a/snooty.toml +++ b/snooty.toml @@ -1,14 +1,13 @@ name = "c" title = "C Driver" -intersphinx = [ "https://www.mongodb.com/docs/manual/objects.inv", - "https://www.mongodb.com/docs/atlas/objects.inv", - "https://www.mongodb.com/docs/drivers/objects.inv", - ] - -toc_landing_pages = [ - "/read" +intersphinx = [ + "https://www.mongodb.com/docs/manual/objects.inv", + "https://www.mongodb.com/docs/atlas/objects.inv", + "https://www.mongodb.com/docs/drivers/objects.inv", ] + +toc_landing_pages = ["/read"] sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" [constants] @@ -26,3 +25,5 @@ driver-short = "C driver" language = "C" mdb-server = "MongoDB Server" stable-api = "Stable API" +libmongoc = "libmongoc" +libbson = "libbson" diff --git a/source/get-started.txt b/source/get-started.txt new file mode 100644 index 00000000..8a9b56a7 --- /dev/null +++ b/source/get-started.txt @@ -0,0 +1,48 @@ +.. _c-get-started: + +============================= +Get Started with the {+driver-short+} +============================= + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: tutorial + +.. meta:: + :description: Learn how to create an app to connect to MongoDB deployment by using the C driver. + :keywords: quick start, tutorial, basics + +.. toctree:: + + /get-started/download-and-install/ + /get-started/create-a-deployment/ + /get-started/create-a-connection-string/ + /get-started/connect-to-mongodb/ + /get-started/next-steps/ + +Overview +-------- + +Overview +-------- + +The {+driver-long+} is a {+language+} library that you can use to connect to MongoDB and +interact with data stored in your deployment. This guide shows you how to create an +application that uses the {+driver-short+} to connect to a MongoDB cluster hosted on +MongoDB Atlas and query data in your cluster. + +.. tip:: + + MongoDB Atlas is a fully managed cloud database service that hosts your MongoDB + deployments. You can create your own free (no credit card required) MongoDB Atlas + deployment by following the steps in this guide. + +Follow this guide to connect a sample {+language+} application to a MongoDB Atlas +deployment. If you prefer to connect to MongoDB using a different driver or +programming language, see our :driver:`list of official drivers <>`. \ No newline at end of file diff --git a/source/get-started/connect-to-mongodb.txt b/source/get-started/connect-to-mongodb.txt new file mode 100644 index 00000000..3cb77210 --- /dev/null +++ b/source/get-started/connect-to-mongodb.txt @@ -0,0 +1,5 @@ +.. _c-get-started-connect-to-mongodb: + +================== +Connect to MongoDB +================== \ No newline at end of file diff --git a/source/get-started/create-a-connection-string.txt b/source/get-started/create-a-connection-string.txt new file mode 100644 index 00000000..57fbc52c --- /dev/null +++ b/source/get-started/create-a-connection-string.txt @@ -0,0 +1,5 @@ +.. _c-get-started-connection-string: + +========================== +Create a Connection String +========================== \ No newline at end of file diff --git a/source/get-started/create-a-deployment.txt b/source/get-started/create-a-deployment.txt new file mode 100644 index 00000000..c0b4cfb3 --- /dev/null +++ b/source/get-started/create-a-deployment.txt @@ -0,0 +1,5 @@ +.. _c-get-started-create-deployment: + +=========================== +Create a MongoDB Deployment +=========================== \ No newline at end of file diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt new file mode 100644 index 00000000..0a5a9d3a --- /dev/null +++ b/source/get-started/download-and-install.txt @@ -0,0 +1,202 @@ +.. _c-get-started-download-and-install: + +==================== +Download and Install +==================== + +.. procedure:: + :style: connected + + .. step:: Download the {+driver-short+} + + THe {+driver-short+} consists of two libraries: ``libbson`` and + ``libmongoc``. In this guide, you will learn how to install ``libmongoc``, + which comes bundled with ``libbson``. + + You can install the {+driver-short+} by using + a package manager, or by installing the libraries from source. To learn + how to install by using a package manager, select the tab corresponding to + your operating system: + + .. tabs:: + + .. tab:: MacOS + :tabid: install-mac + + You can download the {+driver-short+} on MacOS by using the `Homebrew + package manager `__. To do so, run the following command in + your shell: + + .. code-block:: bash + + brew install mongo-c-driver + + .. tab:: Linux + :tabid: install-linux + + You can download the {+driver-short+} on the following Linux + distrubutions: + + .. _c-redhat-install: + + RedHat Enterprise Linux + ~~~~~~~~~~~~~~~~~~~~~~~ + + You can install the driver on RedHat Enterprise Linux (RHEL) + distribution version 7 or later, or distributions based on RHEL + version 7 or later such as: + + - CentOS + - Rocky Linux + - AlmaLinux + + Before you install the driver on a RHEL distribution, not including + Fedora, you must first enable the Extra Packages for Enterprise + Linux (EPEL) repository. You can enable the EPEL repository by + installing the ``epel-release`` package, as shown in the following + example: + + .. code-block:: bash + + yum install epel-release + + Then, you can install the {+driver-short+} + by using ``yum``. To do so, run the following command in + your shell: + + .. code-block:: bash + + yum install mongo-c-driver-devel + + The preceding code example installs the developer packages, which + are required to build applications that use the {+driver-short+}. To + install only the libraries, without development files, run the + following command: + + .. code-block:: bash + + yum install mongo-c-driver + + .. tip:: + + If you are installing on a RHEL distribution that is version 8 or + later, we recommend running the preceding code examples by using + ``dnf`` instead of ``yum``. + + Fedora + ~~~~~~ + + If you are using Fedora or an enterprise Linux distribution of + version 8 or later, you can install the driver by using the same + commands as shown in the :ref:`preceding example ` + and replacing ``yum`` with ``dnf``. + + The following example shows how to install the {+driver-short+} in a + Fedora distribution: + + .. code-block:: bash + + dnf install mongo-c-driver-devel + + Debian-Based Distributions + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + In Debian-Based Linux distributions, including Ubuntu and Ubuntu + derivatives, the driver libraries are available through the Advanced + Packaging Tool (APT). You can install the driver with APT by running + the following command in your shell: + + .. code-block:: bash + + apt install libmongoc-dev + + The preceding code example installs the developer packages, which + are required to build applications that use the {+driver-short+}. To + install only the libraries, without development files, run the + following command: + + .. code-block:: bash + + apt install libmongoc-1.0-0 + + .. tab:: Windows + :tabid: install-windows + + For windows environments, we recommend building the {+driver-short+} + libraries from source to ensure maximum compatibility with the local + toolchain. You can automate building from source by using a + from-source library package management tool, such as + `vcpkg `__. + + To learn how to install the driver by using vcpkg, select the + tab corresponding to the mode you want to use: + + .. tabs:: + + .. tab:: vcpkg Manifest Mode (Recommended) + :tabid: vcpkg-manifest + + In `vcpkg manifest mode `__, add the + driver library to your project's ``vcpkg.json`` manifest file, + as shown in the following example: + + .. code-block:: js + + { + // ... + "dependencies": [ + // ... + "mongo-c-driver" + ] + } + + When you build a CMake project with vcpkg integration and have a + ``vcpkg.json`` manifest file, vcpkg automatically installs the project's + dependencies before proceeding with configuration. + + .. tab:: vcpkg Classic Mode + :tabid: vcpkg-classic + + In `vcpkg classic mode `__, + you can install the driver by running the following command in + your shell: + + .. code-block:: bash + + vcpkg install mongo-c-driver + + After you install the driver, the standard CMake configuration file + is available, as well as the generated ``IMPORTED`` targets. You can + create a ``CMakeLists.txt`` file as shown in the following example: + + .. code-block:: cmake + + find_package(mongoc-1.0 CONFIG REQUIRED) + target_link_libraries(my-application + PRIVATE $,mongo::mongoc_shared,mongo::mongoc_static>) + + .. note:: + + You can use the ``$:...>`` generator + expression in the preceding example to switch the link type of + ``libmongoc`` based on the form that is available from the + ``find_package()`` command. ``libmongoc`` supports building with + both *dynamic* and *static* library types, but vcpkg + installs only one type at a time. + + To configure the CMake project with vcpkg integration, set the CMake + toolchain file in the configuration command, as shown in the + following example: + + .. code-block:: bash + + cmake -S . -B _build -D CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake + +.. TODO: + .. To learn how to install the driver libraries from source, see the + .. :ref:`c-install-from-source`` guide. + +After you complete these steps, you have the {+driver-short+} installed +on your machine. + +.. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file diff --git a/source/get-started/next-steps.txt b/source/get-started/next-steps.txt new file mode 100644 index 00000000..a6adfd0f --- /dev/null +++ b/source/get-started/next-steps.txt @@ -0,0 +1,5 @@ +.. _c-get-started-next-steps: + +========== +Next Steps +========== \ No newline at end of file diff --git a/source/includes/get-started/troubleshoot.rst b/source/includes/get-started/troubleshoot.rst new file mode 100644 index 00000000..14980b3d --- /dev/null +++ b/source/includes/get-started/troubleshoot.rst @@ -0,0 +1,6 @@ +.. note:: + + If you run into issues on this step, ask for help in the + :community-forum:`MongoDB Community Forums ` + or submit feedback by using the :guilabel:`Rate this page` + tab on the right or bottom right side of this page. \ No newline at end of file diff --git a/source/index.txt b/source/index.txt index 51904a24..40baf7bd 100644 --- a/source/index.txt +++ b/source/index.txt @@ -6,6 +6,7 @@ :titlesonly: :maxdepth: 1 + /get-started /databases-collections /read libbson API Documentation <{+api-libbson+}> @@ -21,12 +22,11 @@ the official MongoDB driver for {+language+} applications. .. ``libmongoc`` depends on the ``libbson`` library. To learn more about ``libbson``, see .. . -.. TODO -.. Get Started -.. ----------- +Get Started +----------- -.. Learn how to install the driver, establish a connection to MongoDB, and begin -.. working with data in the :ref:`c-get-started` tutorial. +Learn how to install the driver, establish a connection to MongoDB, and begin +working with data in the :ref:`c-get-started` tutorial. .. TODO .. Connect to MongoDB From 456ddf05d063e234143ae83c49748a252d4c516b Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Thu, 12 Sep 2024 12:02:49 -0700 Subject: [PATCH 2/6] make landing page clickable --- snooty.toml | 2 +- source/get-started/download-and-install.txt | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/snooty.toml b/snooty.toml index f3733b96..3b4b530c 100644 --- a/snooty.toml +++ b/snooty.toml @@ -7,7 +7,7 @@ intersphinx = [ "https://www.mongodb.com/docs/drivers/objects.inv", ] -toc_landing_pages = ["/read"] +toc_landing_pages = ["/read", "/get-started"] sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" [constants] diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt index 0a5a9d3a..10653a01 100644 --- a/source/get-started/download-and-install.txt +++ b/source/get-started/download-and-install.txt @@ -5,7 +5,7 @@ Download and Install ==================== .. procedure:: - :style: connected + :style: normal .. step:: Download the {+driver-short+} @@ -196,7 +196,4 @@ Download and Install .. To learn how to install the driver libraries from source, see the .. :ref:`c-install-from-source`` guide. -After you complete these steps, you have the {+driver-short+} installed -on your machine. - -.. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file + .. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file From d92280c96aa71319068f3c0e236470c5e6a31c0c Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Thu, 12 Sep 2024 13:08:32 -0700 Subject: [PATCH 3/6] fix rst and remove nested tabs --- source/get-started.txt | 3 - source/get-started/download-and-install.txt | 339 ++++++++++---------- 2 files changed, 162 insertions(+), 180 deletions(-) diff --git a/source/get-started.txt b/source/get-started.txt index 8a9b56a7..812efb9b 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -29,9 +29,6 @@ Get Started with the {+driver-short+} Overview -------- -Overview --------- - The {+driver-long+} is a {+language+} library that you can use to connect to MongoDB and interact with data stored in your deployment. This guide shows you how to create an application that uses the {+driver-short+} to connect to a MongoDB cluster hosted on diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt index 10653a01..03886ce4 100644 --- a/source/get-started/download-and-install.txt +++ b/source/get-started/download-and-install.txt @@ -4,196 +4,181 @@ Download and Install ==================== -.. procedure:: - :style: normal +Download the {+driver-short+} +---------------------- - .. step:: Download the {+driver-short+} +The {+driver-short+} consists of two libraries: ``libbson`` and +``libmongoc``. In this guide, you will learn how to install ``libmongoc``, +which comes bundled with ``libbson``. + +You can install the {+driver-short+} by using +a package manager, or by installing the libraries from source. To learn +how to install by using a package manager, select the tab corresponding to +your operating system: - THe {+driver-short+} consists of two libraries: ``libbson`` and - ``libmongoc``. In this guide, you will learn how to install ``libmongoc``, - which comes bundled with ``libbson``. - - You can install the {+driver-short+} by using - a package manager, or by installing the libraries from source. To learn - how to install by using a package manager, select the tab corresponding to - your operating system: +.. tabs:: - .. tabs:: + .. tab:: Linux + :tabid: install-linux - .. tab:: MacOS - :tabid: install-mac + .. _c-redhat-install: - You can download the {+driver-short+} on MacOS by using the `Homebrew - package manager `__. To do so, run the following command in - your shell: + RedHat Enterprise Linux Distributions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - .. code-block:: bash + You can install the driver on RedHat Enterprise Linux (RHEL) + distributions, version 7 or later, or distributions based on RHEL, + such as: - brew install mongo-c-driver - - .. tab:: Linux - :tabid: install-linux - - You can download the {+driver-short+} on the following Linux - distrubutions: - - .. _c-redhat-install: - - RedHat Enterprise Linux - ~~~~~~~~~~~~~~~~~~~~~~~ - - You can install the driver on RedHat Enterprise Linux (RHEL) - distribution version 7 or later, or distributions based on RHEL - version 7 or later such as: - - - CentOS - - Rocky Linux - - AlmaLinux - - Before you install the driver on a RHEL distribution, not including - Fedora, you must first enable the Extra Packages for Enterprise - Linux (EPEL) repository. You can enable the EPEL repository by - installing the ``epel-release`` package, as shown in the following - example: - - .. code-block:: bash - - yum install epel-release - - Then, you can install the {+driver-short+} - by using ``yum``. To do so, run the following command in - your shell: - - .. code-block:: bash - - yum install mongo-c-driver-devel - - The preceding code example installs the developer packages, which - are required to build applications that use the {+driver-short+}. To - install only the libraries, without development files, run the - following command: - - .. code-block:: bash - - yum install mongo-c-driver - - .. tip:: - - If you are installing on a RHEL distribution that is version 8 or - later, we recommend running the preceding code examples by using - ``dnf`` instead of ``yum``. - - Fedora - ~~~~~~ - - If you are using Fedora or an enterprise Linux distribution of - version 8 or later, you can install the driver by using the same - commands as shown in the :ref:`preceding example ` - and replacing ``yum`` with ``dnf``. - - The following example shows how to install the {+driver-short+} in a - Fedora distribution: - - .. code-block:: bash - - dnf install mongo-c-driver-devel - - Debian-Based Distributions - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - In Debian-Based Linux distributions, including Ubuntu and Ubuntu - derivatives, the driver libraries are available through the Advanced - Packaging Tool (APT). You can install the driver with APT by running - the following command in your shell: - - .. code-block:: bash - - apt install libmongoc-dev + - `CentOS `__ + - `Rocky Linux `__ + - `AlmaLinux `__ + + Before you install the driver on a RHEL distribution, not including + Fedora, you must first enable the Extra Packages for Enterprise + Linux (EPEL) repository. You can enable the EPEL repository by + installing the ``epel-release`` package, as shown in the following + example: + + .. code-block:: bash + + yum install epel-release + + Then, you can install the {+driver-short+} + by using ``yum``. To do so, run the following command in + your shell: + + .. code-block:: bash + + yum install mongo-c-driver-devel + + The preceding code example installs the developer packages, which + are required to build applications that use the {+driver-short+}. To + install only the libraries, without development files, run the + following command: + + .. code-block:: bash + + yum install mongo-c-driver + + .. tip:: + + If you are installing on a RHEL distribution that is version 8 or + later, we recommend running the preceding code examples by using + ``dnf`` instead of ``yum`` + + Fedora + ~~~~~~ + + If you are using Fedora or an enterprise Linux distribution of + version 8 or later, you can install the driver by using the same + commands as shown in the :ref:`preceding example ` + and replacing ``yum`` with ``dnf``. + + The following example shows how to install the {+driver-short+} in a + Fedora distribution: + + .. code-block:: bash + + dnf install mongo-c-driver-devel + + Debian-Based Distributions + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + In Debian-Based Linux distributions, including Ubuntu and Ubuntu + derivatives, the driver libraries are available through the Advanced + Packaging Tool (APT). You can install the driver with APT by running + the following command in your shell: + + .. code-block:: bash + + apt install libmongoc-dev + + The preceding code example installs the developer packages, which + are required to build applications that use the {+driver-short+}. To + install only the libraries, without development files, run the + following command: + + .. code-block:: bash + + apt install libmongoc-1.0-0 + + .. tab:: Windows + :tabid: install-windows + + For windows environments, we recommend building the {+driver-short+} + libraries from source to ensure maximum compatibility with the local + toolchain. You can automate building from source by using a + from-source library package management tool, such as + `vcpkg `__. + + In `vcpkg manifest mode `__, add the + driver library to your project's ``vcpkg.json`` manifest file, + as shown in the following example: + + .. code-block:: js + + { + // ... + "dependencies": [ + // ... + "mongo-c-driver" + ] + } + + When you build a CMake project with vcpkg integration and have a + ``vcpkg.json`` manifest file, vcpkg automatically installs the project's + dependencies before proceeding with configuration. + + In `vcpkg classic mode `__, + you can install the driver by running the following command in + your shell: + + .. code-block:: bash + + vcpkg install mongo-c-driver + + After you install the driver, the standard CMake configuration file + is available, as well as the generated ``IMPORTED`` targets. You can + create a ``CMakeLists.txt`` file as shown in the following example: + + .. code-block:: cmake + + find_package(mongoc-1.0 CONFIG REQUIRED) + target_link_libraries(my-application + PRIVATE $,mongo::mongoc_shared,mongo::mongoc_static>) + + .. note:: + + You can use the ``$:...>`` generator + expression in the preceding example to switch the link type of + ``libmongoc`` based on the form that is available from the + ``find_package()`` command. ``libmongoc`` supports building with + both *dynamic* and *static* library types, but vcpkg + installs only one type at a time. + + To configure the CMake project with vcpkg integration, set the CMake + toolchain file in the configuration command, as shown in the + following example: + + .. code-block:: bash + + cmake -S . -B _build -D + CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake - The preceding code example installs the developer packages, which - are required to build applications that use the {+driver-short+}. To - install only the libraries, without development files, run the - following command: - - .. code-block:: bash - - apt install libmongoc-1.0-0 + .. tab:: MacOS + :tabid: install-mac - .. tab:: Windows - :tabid: install-windows + You can download the {+driver-short+} on MacOS by using the `Homebrew + package manager `__. To do so, run the following command in + your shell: - For windows environments, we recommend building the {+driver-short+} - libraries from source to ensure maximum compatibility with the local - toolchain. You can automate building from source by using a - from-source library package management tool, such as - `vcpkg `__. + .. code-block:: bash - To learn how to install the driver by using vcpkg, select the - tab corresponding to the mode you want to use: - - .. tabs:: - - .. tab:: vcpkg Manifest Mode (Recommended) - :tabid: vcpkg-manifest - - In `vcpkg manifest mode `__, add the - driver library to your project's ``vcpkg.json`` manifest file, - as shown in the following example: - - .. code-block:: js - - { - // ... - "dependencies": [ - // ... - "mongo-c-driver" - ] - } - - When you build a CMake project with vcpkg integration and have a - ``vcpkg.json`` manifest file, vcpkg automatically installs the project's - dependencies before proceeding with configuration. - - .. tab:: vcpkg Classic Mode - :tabid: vcpkg-classic - - In `vcpkg classic mode `__, - you can install the driver by running the following command in - your shell: - - .. code-block:: bash - - vcpkg install mongo-c-driver - - After you install the driver, the standard CMake configuration file - is available, as well as the generated ``IMPORTED`` targets. You can - create a ``CMakeLists.txt`` file as shown in the following example: - - .. code-block:: cmake - - find_package(mongoc-1.0 CONFIG REQUIRED) - target_link_libraries(my-application - PRIVATE $,mongo::mongoc_shared,mongo::mongoc_static>) - - .. note:: - - You can use the ``$:...>`` generator - expression in the preceding example to switch the link type of - ``libmongoc`` based on the form that is available from the - ``find_package()`` command. ``libmongoc`` supports building with - both *dynamic* and *static* library types, but vcpkg - installs only one type at a time. - - To configure the CMake project with vcpkg integration, set the CMake - toolchain file in the configuration command, as shown in the - following example: - - .. code-block:: bash - - cmake -S . -B _build -D CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake + brew install mongo-c-driver .. TODO: .. To learn how to install the driver libraries from source, see the .. :ref:`c-install-from-source`` guide. - .. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file +.. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file From 5aa7a103c10cc904b5cba9fa8691c4d5a4199acb Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Fri, 13 Sep 2024 08:39:06 -0700 Subject: [PATCH 4/6] add vcpkg link --- source/get-started/download-and-install.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt index 03886ce4..4b9861c9 100644 --- a/source/get-started/download-and-install.txt +++ b/source/get-started/download-and-install.txt @@ -111,6 +111,12 @@ your operating system: toolchain. You can automate building from source by using a from-source library package management tool, such as `vcpkg `__. + + .. tip:: + + To learn how to get started with vcpkg, see the `vcpkg Get Started + guide `__ + in the Microsoft documentation. In `vcpkg manifest mode `__, add the driver library to your project's ``vcpkg.json`` manifest file, @@ -130,7 +136,7 @@ your operating system: ``vcpkg.json`` manifest file, vcpkg automatically installs the project's dependencies before proceeding with configuration. - In `vcpkg classic mode `__, + If you are using `vcpkg classic mode `__, you can install the driver by running the following command in your shell: @@ -181,4 +187,7 @@ your operating system: .. To learn how to install the driver libraries from source, see the .. :ref:`c-install-from-source`` guide. +After you complete these steps, you have the {+driver-short+} installed +on your machine. + .. include:: /includes/get-started/troubleshoot.rst \ No newline at end of file From bd4bef283d996c1839f09d08c6854e3876bf4c82 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Fri, 13 Sep 2024 11:37:21 -0700 Subject: [PATCH 5/6] Michael feedback --- source/get-started/download-and-install.txt | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt index 4b9861c9..3ea1acbc 100644 --- a/source/get-started/download-and-install.txt +++ b/source/get-started/download-and-install.txt @@ -52,20 +52,20 @@ your operating system: yum install mongo-c-driver-devel - The preceding code example installs the developer packages, which - are required to build applications that use the {+driver-short+}. To - install only the libraries, without development files, run the - following command: + .. note:: Developer Packages + + The preceding code example installs the developer packages, which + are required to build applications that use the {+driver-short+}. To + install only the libraries, without development files, run the + following command: - .. code-block:: bash + .. code-block:: bash - yum install mongo-c-driver + yum install mongo-c-driver - .. tip:: - - If you are installing on a RHEL distribution that is version 8 or - later, we recommend running the preceding code examples by using - ``dnf`` instead of ``yum`` + If you are installing on a RHEL distribution that is version 8 or + later, we recommend running the preceding code examples by using + ``dnf`` instead of ``yum``. Fedora ~~~~~~ @@ -106,7 +106,7 @@ your operating system: .. tab:: Windows :tabid: install-windows - For windows environments, we recommend building the {+driver-short+} + For Windows environments, we recommend building the {+driver-short+} libraries from source to ensure maximum compatibility with the local toolchain. You can automate building from source by using a from-source library package management tool, such as @@ -164,11 +164,11 @@ your operating system: installs only one type at a time. To configure the CMake project with vcpkg integration, set the CMake - toolchain file in the configuration command, as shown in the - following example: + toolchain file in the configuration command by running the following + commands in your shell: .. code-block:: bash - + cmake -S . -B _build -D CMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake From 7da30f04b8dcf1009d252fe49897bc8f514ccda0 Mon Sep 17 00:00:00 2001 From: Jordan Smith Date: Mon, 16 Sep 2024 08:51:40 -0700 Subject: [PATCH 6/6] add instructions to check version --- source/get-started/download-and-install.txt | 28 ++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/source/get-started/download-and-install.txt b/source/get-started/download-and-install.txt index 3ea1acbc..2631ee60 100644 --- a/source/get-started/download-and-install.txt +++ b/source/get-started/download-and-install.txt @@ -10,10 +10,32 @@ Download the {+driver-short+} The {+driver-short+} consists of two libraries: ``libbson`` and ``libmongoc``. In this guide, you will learn how to install ``libmongoc``, which comes bundled with ``libbson``. - + You can install the {+driver-short+} by using -a package manager, or by installing the libraries from source. To learn -how to install by using a package manager, select the tab corresponding to +a package manager, or by installing the libraries from source. Different Linux +distributions install different versions of the driver when installed with a +package manager. Because of this, you should check the version your distribution +includes before installing the driver. + +On RedHat Enterprise Linux (RHEL) distributions, you can check the version by +running the following command in your shell: + +.. code-block:: bash + + sudo dnf info mongo-c-driver-devel + +On Debian-based distributions, you can check the version by running the +following command in your shell: + +.. code-block:: bash + + apt-cache policy libmongoc-dev + +If the version of the driver that is available is not the version you want, you +can install the driver from source. +.. TODO: To learn how to install the driver from source, see the c-install-from-source guide. + +To learn how to install the driver by using a package manager, select the tab corresponding to your operating system: .. tabs::