|
| 1 | +.. _index: |
| 2 | + |
1 | 3 | ================ |
2 | | -{+driver-long+} |
| 4 | +MongoDB C Driver |
3 | 5 | ================ |
4 | 6 |
|
| 7 | +.. facet:: |
| 8 | + :name: programming_language |
| 9 | + :values: c |
| 10 | + |
| 11 | +.. facet:: |
| 12 | + :name: genre |
| 13 | + :values: reference |
| 14 | + |
| 15 | +.. meta:: |
| 16 | + :keywords: code example, get started, sample app |
| 17 | + |
| 18 | +.. contents:: On this page |
| 19 | + :local: |
| 20 | + :backlinks: none |
| 21 | + :depth: 1 |
| 22 | + :class: twocols |
| 23 | + |
5 | 24 | .. toctree:: |
6 | 25 | :titlesonly: |
7 | 26 | :maxdepth: 1 |
8 | 27 |
|
9 | | - libbson API Documentation <{+api-libbson+}> |
10 | | - libmongoc API Documentation <{+api-libmongoc+}> |
| 28 | + /libbson |
| 29 | + /libmongoc |
11 | 30 |
|
12 | 31 | Introduction |
13 | 32 | ------------ |
14 | 33 |
|
15 | | -Welcome to the documentation site for the {+driver-long+}, also known as **libmongoc**, |
16 | | -the official MongoDB driver for {+language+} applications. |
| 34 | +Welcome to the documentation site for the official MongoDB C driver. |
| 35 | +You can add the driver to your application to work with MongoDB in C. |
| 36 | +Download the required libraries, ``libmongoc`` and ``libbson``, by following |
| 37 | +the :ref:`obtaining_libraries` instructions or set up a runnable project by |
| 38 | +following our tutorial. |
| 39 | + |
| 40 | +- :ref:`Tutorial <mongoc_tutorial>` |
17 | 41 |
|
18 | | -.. TODO: Uncomment when BSON guide is created |
19 | | -.. ``libmongoc`` depends on the ``libbson`` library. To learn more about ``libbson``, see |
20 | | -.. <BSON guide link>. |
| 42 | +- :ref:`Usage Guide <libmongoc>` |
21 | 43 |
|
22 | | -.. TODO |
23 | | -.. Get Started |
24 | | -.. ----------- |
| 44 | +- `MongoDB Developer Center <https://www.mongodb.com/developer/languages/c/>`__ |
25 | 45 |
|
26 | | -.. Learn how to install the driver, establish a connection to MongoDB, and begin |
27 | | -.. working with data in the :ref:`c-get-started` tutorial. |
| 46 | +- `API Reference <https://mongoc.org/libmongoc/current/api.html>`_ |
28 | 47 |
|
29 | | -.. TODO |
30 | | -.. Connect to MongoDB |
31 | | -.. ------------------ |
| 48 | +- `Changelog <https://github.com/mongodb/mongo-c-driver/releases>`__ |
32 | 49 |
|
33 | | -.. Learn how to create and configure a connection to a MongoDB deployment |
34 | | -.. in the :ref:`c-connect` section. |
| 50 | +- `Source Code <https://github.com/mongodb/mongo-c-driver>`__ |
35 | 51 |
|
36 | | -.. TODO |
37 | | -.. What's New |
38 | | -.. ---------- |
| 52 | +- `Examples <https://github.com/mongodb/mongo-c-driver/tree/master/src/libmongoc/examples>`__ |
39 | 53 |
|
40 | | -.. For a list of new features and changes in each version, see the :ref:`What's New <c-whats-new>` |
41 | | -.. section. |
| 54 | +- `Additional BSON Examples <https://github.com/mongodb/mongo-c-driver/tree/master/src/libbson/examples>`__ |
42 | 55 |
|
43 | | -.. TODO |
44 | | -.. Write Data to MongoDB |
45 | | -.. --------------------- |
| 56 | +Connect to MongoDB Atlas |
| 57 | +------------------------ |
46 | 58 |
|
47 | | -.. Learn how you can write data to MongoDB in the :ref:`c-write` section. |
| 59 | +You can use the following connection snippet to test your connection to your |
| 60 | +MongoDB deployment on Atlas: |
48 | 61 |
|
49 | | -.. TODO |
50 | | -.. Read Data from MongoDB |
51 | | -.. ---------------------- |
| 62 | +.. literalinclude:: /includes/c-connection.c |
| 63 | + :language: c |
52 | 64 |
|
53 | | -.. Learn how you can retrieve data from MongoDB in the :ref:`c-read` section. |
| 65 | +This connection snippet uses the Stable API feature. You can access this feature |
| 66 | +when connecting to MongoDB Server v5.0 and later and using the C driver v1.18 and later. |
54 | 67 |
|
55 | | -.. TODO |
56 | | -.. Optimize Queries with Indexes |
57 | | -.. ----------------------------- |
| 68 | +When you use this feature, you can update your driver or server without |
| 69 | +worrying about backward compatibility issues with any commands covered by the |
| 70 | +Stable API. |
58 | 71 |
|
59 | | -.. Learn how to work with common types of indexes in the :ref:`c-indexes` |
60 | | -.. section. |
| 72 | +.. note:: |
61 | 73 |
|
62 | | -.. TODO |
63 | | -.. Transform Your Data with Aggregation |
64 | | -.. ------------------------------------ |
| 74 | + Starting from February 2022, the **Versioned API** is known as the **Stable API**. |
| 75 | + All concepts and features remain the same with this naming change. |
65 | 76 |
|
66 | | -.. Learn how to use the {+driver-short+} to perform aggregation operations in the |
67 | | -.. :ref:`c-aggregation` section. |
| 77 | +.. _connect-atlas-no-stable-api-c-driver: |
68 | 78 |
|
69 | | -.. Learn how to use aggregation expression operations to build |
70 | | -.. aggregation stages in the :ref:`c-aggregation-expression-operations` section. |
| 79 | +Connect to MongoDB Atlas Without the Stable API |
| 80 | +----------------------------------------------- |
71 | 81 |
|
| 82 | +If you are using a version of MongoDB or the driver that lacks support for the |
| 83 | +Stable API, you can use the following code snippet to test your connection |
| 84 | +to your MongoDB deployment on Atlas: |
72 | 85 |
|
73 | | -.. TODO: |
74 | | -.. FAQ |
75 | | -.. --- |
| 86 | +.. literalinclude:: /includes/c-connection-no-stable-api.c |
| 87 | + :language: c |
76 | 88 |
|
77 | | -.. For answers to commonly asked questions about the {+driver-short+}, see the |
78 | | -.. :ref:`FAQ <c-faq>` section. |
| 89 | +Compatibility |
| 90 | +------------- |
79 | 91 |
|
80 | | -.. TODO |
81 | | -.. Connection Troubleshooting |
82 | | -.. -------------------------- |
| 92 | +MongoDB Compatibility |
| 93 | +~~~~~~~~~~~~~~~~~~~~~ |
83 | 94 |
|
84 | | -.. For solutions to some issues you might experience when connecting to a MongoDB |
85 | | -.. deployment while using the {+driver-short+}, see the |
86 | | -.. :ref:`Connection Troubleshooting <c-connection-troubleshooting>` section. |
| 95 | +The compatibility table in this section specifies the recommended version or |
| 96 | +versions of the MongoDB C driver for use with a specific version of MongoDB. |
87 | 97 |
|
88 | | -.. TODO |
89 | | -.. Issues & Help |
90 | | -.. ------------- |
| 98 | +The first column lists the driver version. |
91 | 99 |
|
92 | | -.. Learn how to report bugs, contribute to the driver, and find more resources for |
93 | | -.. asking questions and receiving help in the :ref:`Issues & Help <c-issues-and-help>` section. |
| 100 | +.. sharedinclude:: dbx/lifecycle-schedule-callout.rst |
94 | 101 |
|
95 | | -.. TODO |
96 | | -.. Compatibility |
97 | | -.. ------------- |
| 102 | +.. include:: /libmongoc/includes/mongodb-compatibility-table-c.rst |
98 | 103 |
|
99 | | -.. For the compatibility charts that show the recommended {+driver-short+} version for each |
100 | | -.. {+mdb-server+} version, see the :ref:`Compatibility <c-compatibility>` section. |
| 104 | +.. include:: /libmongoc/includes/older-server-versions-unsupported.rst |
101 | 105 |
|
102 | | -Learn |
103 | | ------- |
| 106 | +Language Compatibility |
| 107 | +~~~~~~~~~~~~~~~~~~~~~~ |
104 | 108 |
|
105 | | -Visit the Developer Hub to learn more about the {+driver-long+}. |
| 109 | +The following compatibility table specifies the recommended version(s) of the |
| 110 | +MongoDB C driver for use with a specific version of C. |
106 | 111 |
|
107 | | -Developer Hub |
108 | | -~~~~~~~~~~~~~ |
| 112 | +The first column lists the driver version(s). |
109 | 113 |
|
110 | | -The Developer Hub provides tutorials and social engagement for |
111 | | -developers. |
| 114 | +.. include:: /libmongoc/includes/language-compatibility-table-c.rst |
112 | 115 |
|
113 | | -To learn how to use MongoDB features with the {+driver-short+}, see the |
114 | | -`How-Tos and Articles page <https://www.mongodb.com/developer/languages/c/>`__. |
| 116 | +.. include:: /libmongoc/includes/about-driver-compatibility.rst |
115 | 117 |
|
116 | | -To ask questions and engage in discussions with fellow developers who |
117 | | -use the {+driver-short+}, see the `forums page <https://www.mongodb.com/community/forums/tag/c-driver>`__. |
| 118 | +.. include:: /libmongoc/includes/help-links-c.rst |
0 commit comments