You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* deprecate `mongoc_(client|database|collection)_command`
* recommend `mongoc_<obj>_command_simple` as a simpler alternative
* add migrating example code
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_client_command.rst
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
mongoc_client_command()
4
4
=======================
5
5
6
+
.. warning::
7
+
.. deprecated:: 1.29.0
8
+
9
+
This function is deprecated and should not be used in new code.
10
+
Use :symbol:`mongoc_client_command_simple()` instead.
11
+
6
12
Synopsis
7
13
--------
8
14
@@ -19,8 +25,6 @@ Synopsis
19
25
const bson_t *fields,
20
26
const mongoc_read_prefs_t *read_prefs);
21
27
22
-
This function is superseded by :symbol:`mongoc_client_command_with_opts()`, :symbol:`mongoc_client_read_command_with_opts()`, :symbol:`mongoc_client_write_command_with_opts()`, and :symbol:`mongoc_client_read_write_command_with_opts()`.
23
-
24
28
.. include:: includes/not-retryable-read.txt
25
29
26
30
Description
@@ -43,6 +47,29 @@ Parameters
43
47
* ``fields``: Unused.
44
48
* ``read_prefs``: An optional :symbol:`mongoc_read_prefs_t`. Otherwise, the command uses mode ``MONGOC_READ_PRIMARY``.
45
49
50
+
Migrating
51
+
---------
52
+
53
+
:symbol:`mongoc_client_command` is deprecated.
54
+
55
+
The following example uses :symbol:`mongoc_client_command`:
56
+
57
+
.. literalinclude:: ../examples/migrating.c
58
+
:language: c
59
+
:dedent: 6
60
+
:start-after: // mongoc_client_command ... before ... begin
61
+
:end-before: // mongoc_client_command ... before ... end
62
+
:caption: Before
63
+
64
+
The above code block may be rewritten to use :symbol:`mongoc_client_command_simple` instead, as shown below:
65
+
66
+
.. literalinclude:: ../examples/migrating.c
67
+
:language: c
68
+
:dedent: 6
69
+
:start-after: // mongoc_client_command ... after ... begin
70
+
:end-before: // mongoc_client_command ... after ... end
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_collection_command.rst
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
mongoc_collection_command()
4
4
===========================
5
5
6
+
.. warning::
7
+
.. deprecated:: 1.29.0
8
+
9
+
This function is deprecated and should not be used in new code.
10
+
Use :symbol:`mongoc_collection_command_simple()` instead.
11
+
6
12
Synopsis
7
13
--------
8
14
@@ -18,22 +24,43 @@ Synopsis
18
24
const bson_t *fields,
19
25
const mongoc_read_prefs_t *read_prefs);
20
26
21
-
This function is superseded by :symbol:`mongoc_collection_command_with_opts()`, :symbol:`mongoc_collection_read_command_with_opts()`, :symbol:`mongoc_collection_write_command_with_opts()`, and :symbol:`mongoc_collection_read_write_command_with_opts()`.
22
-
23
27
.. include:: includes/not-retryable-read.txt
24
28
25
29
Parameters
26
30
----------
27
31
28
32
* ``collection``: A :symbol:`mongoc_collection_t`.
29
-
* ``flags``: A :symbol:`mongoc_query_flags_t`.
30
-
* ``skip``: A uint32_t with the number of documents to skip or zero.
31
-
* ``limit``: A uint32_t with the max number of documents to return or zero.
32
-
* ``batch_size``: A uint32_t with the number of documents in each batch or zero. Default is 100.
33
+
* ``flags``: Unused.
34
+
* ``skip``: Unused.
35
+
* ``limit``: Unused.
36
+
* ``batch_size``: Unused.
33
37
* ``command``: A :symbol:`bson:bson_t` containing the command to execute.
34
-
* ``fields``: A :symbol:`bson:bson_t` containing the fields to return or ``NULL``. Not all commands support this option.
38
+
* ``fields``: Unused.
35
39
* ``read_prefs``: An optional :symbol:`mongoc_read_prefs_t`. Otherwise, the command uses mode ``MONGOC_READ_PRIMARY``.
36
40
41
+
Migrating
42
+
---------
43
+
44
+
:symbol:`mongoc_collection_command` is deprecated.
45
+
46
+
The following example uses :symbol:`mongoc_collection_command`:
47
+
48
+
.. literalinclude:: ../examples/migrating.c
49
+
:language: c
50
+
:dedent: 6
51
+
:start-after: // mongoc_collection_command ... before ... begin
52
+
:end-before: // mongoc_collection_command ... before ... end
53
+
:caption: Before
54
+
55
+
The above code block may be rewritten to use :symbol:`mongoc_collection_command_simple` instead, as shown below:
56
+
57
+
.. literalinclude:: ../examples/migrating.c
58
+
:language: c
59
+
:dedent: 6
60
+
:start-after: // mongoc_collection_command ... after ... begin
61
+
:end-before: // mongoc_collection_command ... after ... end
Copy file name to clipboardExpand all lines: src/libmongoc/doc/mongoc_database_command.rst
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,12 @@
3
3
mongoc_database_command()
4
4
=========================
5
5
6
+
.. warning::
7
+
.. deprecated:: 1.29.0
8
+
9
+
This function is deprecated and should not be used in new code.
10
+
Use :symbol:`mongoc_database_command_simple()` instead.
11
+
6
12
Synopsis
7
13
--------
8
14
@@ -18,8 +24,6 @@ Synopsis
18
24
const bson_t *fields,
19
25
const mongoc_read_prefs_t *read_prefs);
20
26
21
-
This function is superseded by :symbol:`mongoc_database_command_with_opts()`, :symbol:`mongoc_database_read_command_with_opts()`, :symbol:`mongoc_database_write_command_with_opts()`, and :symbol:`mongoc_database_read_write_command_with_opts()`.
22
-
23
27
Description
24
28
-----------
25
29
@@ -31,14 +35,37 @@ Parameters
31
35
----------
32
36
33
37
* ``database``: A :symbol:`mongoc_database_t`.
34
-
* ``flags``: A :symbol:`mongoc_query_flags_t`.
35
-
* ``skip``: The number of documents to skip on the server.
36
-
* ``limit``: The maximum number of documents to return from the cursor.
37
-
* ``batch_size``: Attempt to batch results from the server in groups of ``batch_size`` documents.
38
+
* ``flags``: Unused.
39
+
* ``skip``: Unused.
40
+
* ``limit``: Unused.
41
+
* ``batch_size``: Unused.
38
42
* ``command``: A :symbol:`bson:bson_t` containing the command.
39
-
* ``fields``: An optional :symbol:`bson:bson_t` containing the fields to return. ``NULL`` for all fields.
43
+
* ``fields``: Unused.
40
44
* ``read_prefs``: An optional :symbol:`mongoc_read_prefs_t`. Otherwise, the command uses mode ``MONGOC_READ_PRIMARY``.
41
45
46
+
Migrating
47
+
---------
48
+
49
+
:symbol:`mongoc_database_command` is deprecated.
50
+
51
+
The following example uses :symbol:`mongoc_database_command`:
52
+
53
+
.. literalinclude:: ../examples/migrating.c
54
+
:language: c
55
+
:dedent: 6
56
+
:start-after: // mongoc_database_command ... before ... begin
57
+
:end-before: // mongoc_database_command ... before ... end
58
+
:caption: Before
59
+
60
+
The above code block may be rewritten to use :symbol:`mongoc_database_command_simple` instead, as shown below:
61
+
62
+
.. literalinclude:: ../examples/migrating.c
63
+
:language: c
64
+
:dedent: 6
65
+
:start-after: // mongoc_database_command ... after ... begin
66
+
:end-before: // mongoc_database_command ... after ... end
0 commit comments