Skip to content
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-43368: Cleanup #66

Merged
merged 14 commits into from
Oct 16, 2024
98 changes: 97 additions & 1 deletion source/compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,100 @@ The first column lists the driver version.
.. include:: /includes/compatibility/language-compatibility-table-c.rst

For more information on how to read the compatibility tables, see our guide on
:ref:`MongoDB Compatibility Tables. <about-driver-compatibility>`
:ref:`MongoDB Compatibility Tables. <about-driver-compatibility>`

.. _platform-support:

Platform Compatibility
----------------------

This section includes version compatibility information about platforms and
toolchains that are supported by the {+driver-short+}.

Operating Systems
~~~~~~~~~~~~~~~~~

The following operating systems are continually tested with the {+driver-short+}:

.. list-table::
:header-rows: 1
:align: left

* - Operating System
- Notes

* - Debian
- Versions 9.2, 10.0, and 11.0
* - RHEL
- Versions 7.0, 7.1, 8.1, 8.2, and 8.3. RHEL derivatives
(for example, CentOS, Rocky Linux, or AlmaLinux) of the same release version are
supported. Fedora is also supported, but not continually tested.
* - Ubuntu
- Versions 16.04, 18.04, and 20.04. Subsequent minor releases
are also supported. Ubuntu 22.04 and newer is not yet tested. Ubuntu
derivatives based on supported Ubuntu versions are also supported.
* - Arch Linux
-
* - macOS
- Version 11.0
* - Windows Server 2008 and Windows Server 2016
- Windows variants of the same generation are supported


Compilers
~~~~~~~~~

The following compilers are continually tested with the {+driver-short+}:

.. list-table::
:header-rows: 1
:align: left

* - Compiler
- Notes
* - Clang
- Versions 3.7, 3.8, and 6.0. Newer versions
are also supported, as well as the corresponding Apple Clang releases.
* - GNU Compiler Collection (GCC)
- Versions 4.8, 5.4, 6.3, 7.5, 8.2, 8.3,
9.4, and 10.2. The MinGW-w64 GCC is also tested and supported.
* - Microsoft Visual C++ (MSVC)
- Tested with MSVC 14.x (Visual Studio 2015) and 15.x (Visual Studio
2017). Newer MSVC versions are supported but not yet tested.

Architectures
~~~~~~~~~~~~~

The following CPU architectures are continually tested with the {+driver-short+}:

.. list-table::
:align: left
:header-rows: 1

* - Architecture
- Notes
* - x86 (32-bit)
- Tested only on Windows
* - x86_64 (64-bit x86)
- Tested on Linux, macOS, and Windows
* - ARM / aarch64
- Tested on macOS and Linux
* - Power8 (ppc64le)
- Tested only on Linux
* - zSeries (s390x)
- Tested only on Linux

Additional Platforms
~~~~~~~~~~~~~~~~~~~~

Other platforms and toolchains are not tested, but we expect similar versions
of the preceding platforms to work. If you encounter a platform or toolchain that you
expect to work and find that it does not, please open an issue describing the
problem, or open a `GitHub Pull Request <https://github.com/mongodb/mongo-c-driver/pulls>`__ to fix it.

.. important::

Simple pull requests to fix unsupported platforms are welcome, but will be
considered on a case-by-case basis. The acceptance of a pull request to fix the
libraries on an unsupported platform does not imply full support of that
platform.
2 changes: 1 addition & 1 deletion source/connect.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _c-sync-connect:
.. _c-connect:

==================
Connect to MongoDB
Expand Down
9 changes: 2 additions & 7 deletions source/connect/connection-targets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ Then, pass your connection string to the ``mongoc_client_new()`` function.
Follow the :atlas:`Atlas driver connection guide </driver-connection>`
to retrieve your connection string.

.. TODO, uncomment this and link to correct Stable API page for C, once written.
.. To learn more about the {+stable-api+} feature, see the :ref:`<c-stable-api>`guide.

The following code shows how to use the {+driver-short+} to connect to an Atlas cluster. The
code also uses the ``mongoc_server_api_new()`` function to specify a {+stable-api+} version.

Expand All @@ -52,13 +49,11 @@ code also uses the ``mongoc_server_api_new()`` function to specify a {+stable-ap
:end-before: end-connect-stable-api
:dedent:


.. TODO, add link to Stable API page for C Driver once created

.. tip::

When you connect to Atlas, we recommend using the {+stable-api+} client option to avoid
breaking changes when Atlas upgrades to a new version of {+mdb-server+}.
breaking changes when Atlas upgrades to a new version of {+mdb-server+}. To learn more
about the {+stable-api+}, see the :ref:`c-stable-api` guide.

Local Deployments
-----------------
Expand Down
12 changes: 6 additions & 6 deletions source/connect/mongoclient.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ Connection URI

A standard connection string includes the following components:

.. TODO, add this as last sentence for ``username:password`` description once a c auth page is made:
.. For more information about the ``authSource`` connection option, see :ref:`c-auth`.

.. list-table::
:widths: 20 80
:header-rows: 1
Expand All @@ -56,6 +53,8 @@ A standard connection string includes the following components:

- Optional. Authentication credentials. If you include these, the client
authenticates the user against the database specified in ``authSource``.
For more information about the ``authSource`` connection option, see the
:ref:`c-auth` guide.

* - ``host[:port]``

Expand Down Expand Up @@ -96,9 +95,10 @@ to connect to a MongoDB instance:
You can set the Stable API version client option to avoid breaking changes when
you upgrade to a new server version.

.. TODO, uncomment these once the Stable API for C Driver page is made.
.. To learn more about the Stable API feature,
.. see the :ref:`Stable API page <c-stable-api>`.
.. tip::

To learn more about the {+stable-api+} feature, see the :ref:`c-stable-api`
guide.

The following code shows how you can specify the connection string and the
Stable API client option when connecting to a MongoDB deployment on Atlas
Expand Down
6 changes: 3 additions & 3 deletions source/connect/tls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ trusted by the native certificate store in use on the server.

You can provide the client certificate in the following ways:

- Setting the ``tlscertificatekeyfile`` parameter in your connection string to a `.pem` file containing the root certificate chain
- Using the `mongoc_uri_set_option_as_utf8()` function to set the `MONGOC_URI_TLSCERTIFICATEKEYFILE` option
to a `.pem` file containing the root certificate chain
- Setting the ``tlscertificatekeyfile`` parameter in your connection string to a ``.pem`` file containing the root certificate chain
- Using the ``mongoc_uri_set_option_as_utf8()`` function to set the ``MONGOC_URI_TLSCERTIFICATEKEYFILE`` option
to a ``.pem`` file containing the root certificate chain

.. tabs::

Expand Down
1 change: 1 addition & 0 deletions source/databases-collections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Databases and Collections
:maxdepth: 1

/databases-collections/time-series
/databases-collections/run-command

Overview
--------
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions source/databases-collections/time-series.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The following example creates a time series collection named ``october2024`` in
:start-after: start-create-time-series
:end-before: end-create-time-series
:dedent:
:emphasize-lines: 13-19
:emphasize-lines: 12-18

To verify that you successfully created the time series collection, run
the ``mongoc_database_find_collections_with_opts()`` function on the
Expand All @@ -95,7 +95,7 @@ the ``mongoc_database_find_collections_with_opts()`` function on the
:start-after: start-list-collections
:end-before: end-list-collections
:dedent:
:emphasize-lines: 4-11
:emphasize-lines: 2-9

.. output::

Expand Down
26 changes: 20 additions & 6 deletions source/get-started/connect-to-mongodb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,31 @@ Connect to MongoDB

mkdir c-quickstart

Run the following commands to create a ``quickstart.c`` application file in the ``c-quickstart``
directory:
Select the tab corresponding to your operating system and run the
following commands to create a ``quickstart.c`` application file
in the ``c-quickstart`` directory:

.. code-block:: bash
.. tabs::

.. tab:: macOS / Linux
:tabid: create-file-mac-linux

.. code-block:: bash

cd c-quickstart
touch quickstart.c

.. tab:: Windows
:tabid: create-file-windows

.. code-block:: bash

cd c-quickstart
touch quickstart.c
cd c-quickstart
type nul > quickstart.c

.. step:: Create your {+driver-short+} application

Copy and paste the following code into the ``quickstart.cpp`` file, which queries
Copy and paste the following code into the ``quickstart.c`` file, which queries
the ``movies`` collection in the ``sample_mflix`` database:

.. literalinclude:: /includes/get-started/quickstart.c
Expand Down
5 changes: 2 additions & 3 deletions source/get-started/create-a-connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ The connection string includes the hostname or IP address and
port of your deployment, the authentication mechanism, user credentials
when applicable, and connection options.

.. TODO
.. To connect to an instance or deployment not hosted on Atlas, see the
.. :ref:`c-connection-targets` guide.
To connect to an instance or deployment not hosted on Atlas, see the
:ref:`c-connection-targets` guide.

.. procedure::
:style: connected
Expand Down
8 changes: 2 additions & 6 deletions source/get-started/download-and-install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ following command in your shell:
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.
can install the driver from source. To learn how to install the driver from source,
see the :ref:`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:
Expand Down Expand Up @@ -205,10 +205,6 @@ your operating system:

brew install mongo-c-driver

.. 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.

Expand Down
7 changes: 3 additions & 4 deletions source/includes/aggregation/aggregation.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#include <stdio.h>
#include <bson/bson.h>
#include <mongoc/mongoc.h>
#include <stdio.h>

int
main (int argc, char *argv[])
main (void)
{
mongoc_client_t *client;
mongoc_collection_t *collection;
mongoc_init ();

client =
mongoc_client_new ("<connection string URI>");
client = mongoc_client_new ("<connection string URI>");
collection = mongoc_client_get_collection (client, "sample_restaurants", "restaurants");

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include <mongoc/mongoc.h>
#include <stdio.h>

int main(int argc, char *argv[])
int
main (void)
{
bson_error_t error;

Expand Down
3 changes: 2 additions & 1 deletion source/includes/get-started/quickstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#include <mongoc/mongoc.h>
#include <stdio.h>

int main (int argc, char *argv[])
int
main (void)
{
const bson_t *doc;

Expand Down
8 changes: 3 additions & 5 deletions source/includes/indexes/indexes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
#include <stdio.h>

int
main (int argc, char *argv[])
main (void)
{
mongoc_client_t *client;
mongoc_collection_t *collection;

mongoc_init ();

client =
mongoc_client_new ("<connection string URI>");
collection =
mongoc_client_get_collection (client, "sample_mflix", "movies");
client = mongoc_client_new ("<connection string URI>");
collection = mongoc_client_get_collection (client, "sample_mflix", "movies");

{
// start-remove-index
Expand Down
7 changes: 3 additions & 4 deletions source/includes/read/change-streams.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#include <stdio.h>
#include <bson/bson.h>
#include <mongoc/mongoc.h>
#include <stdio.h>

int
main (int argc, char *argv[])
main (void)
{
mongoc_client_t *client;
mongoc_collection_t *collection;
mongoc_init ();

client =
mongoc_client_new ("<connection string URI>");
client = mongoc_client_new ("<connection string URI>");
collection = mongoc_client_get_collection (client, "sample_restaurants", "restaurants");

{
Expand Down
8 changes: 3 additions & 5 deletions source/includes/read/count.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#include <stdio.h>
#include <bson/bson.h>
#include <mongoc/mongoc.h>
#include <stdio.h>

int
main (int argc, char *argv[])
main (void)
{
mongoc_client_t *client;
mongoc_collection_t *collection;

mongoc_init ();

client =
mongoc_client_new ("<connection string URI>");
client = mongoc_client_new ("<connection string URI>");
collection = mongoc_client_get_collection (client, "sample_mflix", "movies");

{
Expand Down
Loading
Loading