Skip to content

Commit e348980

Browse files
committed
CDRIVER-1979 manual fixes for some RST files
1 parent 7eac27d commit e348980

File tree

453 files changed

+1923
-2838
lines changed

Some content is hidden

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

453 files changed

+1923
-2838
lines changed

doc/aggregate.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Aggregations using the Zip Codes Data Set
4141

4242
Each document in this collection has the following form:
4343

44-
.. code-block:: none
44+
.. code-block:: json
4545
4646
{
4747
"_id" : "35004",
@@ -70,7 +70,7 @@ To get all states with a population greater than 10 million, use the following a
7070

7171
You should see a result like the following:
7272

73-
.. code-block:: none
73+
.. code-block:: json
7474
7575
{ "_id" : "PA", "total_pop" : 11881643 }
7676
{ "_id" : "OH", "total_pop" : 10847115 }
@@ -86,7 +86,7 @@ The ``$group`` pipeline operator requires _id field where we specify grouping; r
8686

8787
The ``$group`` process reads all documents and for each state it creates a separate document, for example:
8888

89-
.. code-block:: none
89+
.. code-block:: json
9090
9191
{ "_id" : "WA", "total_pop" : 4866692 }
9292
@@ -99,7 +99,7 @@ Average City Population by State
9999

100100
To get the first three states with the greatest average population per city, use the following aggregation:
101101

102-
.. code-block:: none
102+
.. code-block:: c
103103
104104
pipeline = BCON_NEW ("pipeline", "[",
105105
"{", "$group", "{", "_id", "{", "state", "$state", "city", "$city", "}", "pop", "{", "$sum", "$pop", "}", "}", "}",
@@ -110,7 +110,7 @@ To get the first three states with the greatest average population per city, use
110110
111111
This aggregate pipeline produces:
112112

113-
.. code-block:: none
113+
.. code-block:: json
114114
115115
{ "_id" : "DC", "avg_city_pop" : 303450.0 }
116116
{ "_id" : "FL", "avg_city_pop" : 27942.29805615551 }
@@ -120,15 +120,15 @@ The above aggregation pipeline is build from three pipeline operators: ``$group`
120120

121121
The first ``$group`` operator creates the following documents:
122122

123-
.. code-block:: none
123+
.. code-block:: json
124124
125125
{ "_id" : { "state" : "WY", "city" : "Smoot" }, "pop" : 414 }
126126
127127
Note, that the ``$group`` operator can't use nested documents except the ``_id`` field.
128128

129129
The second ``$group`` uses these documents to create the following documents:
130130

131-
.. code-block:: none
131+
.. code-block:: json
132132
133133
{ "_id" : "FL", "avg_city_pop" : 27942.29805615551 }
134134

doc/api.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:man_page: mongoc_api
2+
3+
API Reference
4+
=============
5+
6+
.. toctree::
7+
:titlesonly:
8+
:maxdepth: 1
9+
10+
init-cleanup
11+
logging
12+
errors
13+
mongoc_version
14+
mongoc_bulk_operation_t
15+
mongoc_client_pool_t
16+
mongoc_client_t
17+
mongoc_collection_t
18+
mongoc_cursor_t
19+
mongoc_database_t
20+
mongoc_delete_flags_t
21+
mongoc_find_and_modify_opts_t
22+
mongoc_gridfs_file_list_t
23+
mongoc_gridfs_file_opt_t
24+
mongoc_gridfs_file_t
25+
mongoc_gridfs_t
26+
mongoc_host_list_t
27+
mongoc_index_opt_geo_t
28+
mongoc_index_opt_t
29+
mongoc_index_opt_wt_t
30+
mongoc_insert_flags_t
31+
mongoc_iovec_t
32+
mongoc_matcher_t
33+
mongoc_query_flags_t
34+
mongoc_rand
35+
mongoc_read_concern_t
36+
mongoc_read_mode_t
37+
mongoc_read_prefs_t
38+
mongoc_remove_flags_t
39+
mongoc_reply_flags_t
40+
mongoc_server_description_t
41+
mongoc_socket_t
42+
mongoc_ssl_opt_t
43+
mongoc_stream_buffered_t
44+
mongoc_stream_file_t
45+
mongoc_stream_gridfs_t
46+
mongoc_stream_socket_t
47+
mongoc_stream_t
48+
mongoc_stream_tls_t
49+
mongoc_topology_description_t
50+
mongoc_update_flags_t
51+
mongoc_uri_t
52+
mongoc_write_concern_t

doc/application-performance-monitoring.rst

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:man_page: mongoc_application_performance_monitoring
22

3-
Introduction to Application Performance Monitoring (APM)
4-
========================================================
3+
Application Performance Monitoring (APM)
4+
========================================
55

66
The MongoDB C Driver allows you to monitor all the MongoDB operations the driver executes. This event-notification system conforms to two MongoDB driver specs:
77

@@ -115,3 +115,26 @@ This example program prints something like:
115115
116116
The driver discovers the third member, "localhost:27019", and adds it to the topology.
117117

118+
119+
.. only:: html
120+
121+
Functions
122+
---------
123+
124+
.. toctree::
125+
:titlesonly:
126+
:maxdepth: 1
127+
128+
mongoc_apm_callbacks_t
129+
mongoc_apm_command_failed_t
130+
mongoc_apm_command_started_t
131+
mongoc_apm_command_succeeded_t
132+
mongoc_apm_server_changed_t
133+
mongoc_apm_server_closed_t
134+
mongoc_apm_server_heartbeat_failed_t
135+
mongoc_apm_server_heartbeat_started_t
136+
mongoc_apm_server_heartbeat_succeeded_t
137+
mongoc_apm_server_opening_t
138+
mongoc_apm_topology_changed_t
139+
mongoc_apm_topology_closed_t
140+
mongoc_apm_topology_opening_t

doc/authentication.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ Simply provide the username and password as one would with an ``HTTP URL``, as w
2121
GSSAPI (Kerberos) Authentication
2222
--------------------------------
2323

24-
.. warning::
24+
.. note::
2525

2626
Kerberos support is only provided in environments supported by the ``cyrus-sasl`` Kerberos implementation. This currently limits support to UNIX-like environments.
2727

2828
``GSSAPI`` (Kerberos) authentication is available in the Enterprise Edition of MongoDB, version 2.4 and newer. To authenticate using ``GSSAPI``, the MongoDB C driver must be installed with SASL support. Run the ``kinit`` command before using the following authentication methods:
2929

3030
.. code-block:: none
3131
32-
$ kinit [email protected]@EXAMPLE.COM's Password:$ klistCredentials cache: FILE:/tmp/krb5cc_1000
32+
$ kinit [email protected]@EXAMPLE.COM's Password:
33+
$ klistCredentials cache: FILE:/tmp/krb5cc_1000
3334
Principal: [email protected]
3435
3536
Issued Expires Principal
@@ -66,13 +67,13 @@ If you encounter errors such as ``Invalid net address``, check if the applicatio
6667
SASL Plain Authentication
6768
-------------------------
6869

69-
.. warning::
70+
.. note::
7071

7172
The MongoDB C Driver must be compiled with SASL support in order to use ``SASL PLAIN`` authentication.
7273

7374
MongoDB Enterprise Edition versions 2.5.0 and newer support the ``SASL PLAIN`` authentication mechanism, initially intended for delegating authentication to an LDAP server. Using the ``SASL PLAIN`` mechanism is very similar to the challenge response mechanism with usernames and passwords. These examples use the ``$external`` virtual database for ``LDAP`` support:
7475

75-
.. warning::
76+
.. note::
7677

7778
``SASL PLAIN`` is a clear-text authentication mechanism. It is strongly recommended to connect to MongoDB using SSL with certificate validation when using the ``PLAIN`` mechanism.
7879

@@ -85,7 +86,7 @@ MongoDB Enterprise Edition versions 2.5.0 and newer support the ``SASL PLAIN`` a
8586
X.509 Certificate Authentication
8687
--------------------------------
8788

88-
.. warning::
89+
.. note::
8990

9091
The MongoDB C Driver must be compiled with SSL support for X.509 authentication support. Once this is done, start a server with the following options:
9192

doc/basic-troubleshooting.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ The following is a short list of things to check when you have a problem.
1717
Performance Counters
1818
--------------------
1919

20-
The MongoDB C driver comes with a unique feature to help developers and sysadmins troubleshoot problems in production.
21-
Performance counters are available for each process using the driver.
22-
The counters can be accessed outside of the application process via a shared memory segment.
23-
This means that you can graph statistics about your application process easily from tools like Munin or Nagios.
24-
Your author often uses ``watch --interval=0.5 -d mongoc-stat $PID`` to monitor an application.
20+
The MongoDB C driver comes with a unique feature to help developers and sysadmins troubleshoot problems in production.
21+
Performance counters are available for each process using the driver.
22+
The counters can be accessed outside of the application process via a shared memory segment.
23+
This means that you can graph statistics about your application process easily from tools like Munin or Nagios.
24+
Your author often uses ``watch --interval=0.5 -d mongoc-stat $PID`` to monitor an application.
2525

26-
27-
.. note::
28-
29-
Counters are currently available on UNIX-like platforms that support shared memory segments.
26+
Counters are currently available on UNIX-like platforms that support shared memory segments.
3027

3128
* Active and Disposed Cursors
3229
* Active and Disposed Clients, Client Pools, and Socket Streams.

doc/bulk.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Bulk Insert
1010

1111
First we need to fetch a bulk operation handle from the :symbol:`mongoc_collection_t <mongoc_collection_t>`. This can be performed in either ordered or unordered mode. Unordered mode allows for greater parallelization when working with sharded clusters.
1212

13-
.. code-block:: none
13+
.. code-block:: c
1414
15-
mongoc_bulk_operation_t *bulk = mongoc_collection_create_bulk_operation (collection, true, write_concern);
15+
mongoc_bulk_operation_t *bulk =
16+
mongoc_collection_create_bulk_operation (collection, true, write_concern);
1617
1718
We can now start inserting documents to the bulk operation. These will be buffered until we execute the operation.
1819

@@ -108,12 +109,12 @@ Example ``reply`` document:
108109
109110
The :symbol:`bson_error_t <errors>` domain is ``MONGOC_ERROR_COMMAND`` and its code is 11000.
110111

112+
.. _bulk_operation_bypassing_document_validation:
113+
111114
Bulk Operation Bypassing Document Validation
112115
--------------------------------------------
113116

114-
.. tip::
115-
116-
This feature is only available when using MongoDB 3.2 and later.
117+
This feature is only available when using MongoDB 3.2 and later.
117118

118119
By default bulk operations are validated against the schema, if any is defined. In certain cases however it may be necessary to bypass the document validation.
119120

@@ -177,9 +178,7 @@ The :symbol:`bson_error_t <errors>` domain is ``MONGOC_ERROR_WRITE_CONCERN`` if
177178
Setting Collation Order
178179
-----------------------
179180

180-
.. tip::
181-
182-
This feature is only available when using MongoDB 3.4 and later.
181+
This feature is only available when using MongoDB 3.4 and later.
183182

184183
.. literalinclude:: ../examples/bulk/bulk-collation.c
185184
:language: c

doc/cursors.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Cursors exist on a MongoDB server. However, the ``mongoc_cursor_t`` structure gi
1010

1111
While iterating cursors, you should check to see if an error has occurred. See the following example for how to robustly check for errors.
1212

13-
.. code-block:: none
13+
.. code-block:: c
1414
1515
static void
1616
print_all_documents (mongoc_collection_t *collection)
@@ -50,9 +50,9 @@ Tailable cursors are cursors that remain open even after they've returned a fina
5050

5151
Here's a complete test case that demonstrates the use of tailable cursors.
5252

53-
.. info::
53+
.. note::
5454

55-
Note that tailable cursors are for capped collections only.
55+
Tailable cursors are for capped collections only.
5656

5757
An example to tail the oplog from a replicaSet.
5858

@@ -66,9 +66,7 @@ Let's compile and run this example against a replica set to see updates as they
6666
6767
$ gcc -Wall -o mongoc-tail mongoc-tail.c $(pkg-config --cflags --libs libmongoc-1.0)$ ./mongoc-tail mongodb://example.com/?replicaSet=myReplSet{ "ts" : { "$timestamp" : { "t" : 1400023818, "i" : 1 } }, "h" : -8458503739429355503, "v" : 2, "op" : "i", "ns" : "test.test", "o" : { "_id" : { "$oid" : "5372ab0a25164be923d10d50" } } }
6868
69-
.. tip::
70-
71-
The line of output is a sample from performing ``db.test.insert({})`` from the mongo shell on the given replicaSet.
69+
The line of output is a sample from performing ``db.test.insert({})`` from the mongo shell on the given replicaSet.
7270

7371
See also :symbol:`mongoc_cursor_set_max_await_time_ms <mongoc_cursor_set_max_await_time_ms>`.
7472

doc/deleting-document.rst

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)