Skip to content

Commit 86bb932

Browse files
committed
CDRIVER-942 docs for copy_collection and copy_database
1 parent 729a389 commit 86bb932

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

doc/mongoc_collection_copy.page

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0"?>
2+
<page xmlns="http://projectmallard.org/1.0/"
3+
type="topic"
4+
style="function"
5+
xmlns:api="http://projectmallard.org/experimental/api/"
6+
xmlns:ui="http://projectmallard.org/experimental/ui/"
7+
id="mongoc_collection_copy">
8+
9+
<info>
10+
<link type="guide" xref="mongoc_collection_t" group="function"/>
11+
</info>
12+
<title>mongoc_collection_copy()</title>
13+
14+
<section id="synopsis">
15+
<title>Synopsis</title>
16+
<synopsis><code mime="text/x-csrc"><![CDATA[mongoc_collection_t *
17+
mongoc_collection_copy (mongoc_collection_t *collection);
18+
]]></code></synopsis>
19+
</section>
20+
21+
<section id="parameters">
22+
<title>Parameters</title>
23+
<table>
24+
<tr><td><p>collection</p></td><td><p>A <code xref="mongoc_collection_t">mongoc_collection_t</code>.</p></td></tr>
25+
</table>
26+
</section>
27+
28+
<section id="description">
29+
<title>Description</title>
30+
<p>Performs a deep copy of the <code>collection</code> struct and its configuration. Useful if you intend to call <code xref="mongoc_collection_set_write_concern">mongoc_collection_set_write_concern</code>, <code xref="mongoc_collection_set_read_prefs">mongoc_collection_set_read_prefs</code>, or <code xref="mongoc_collection_set_read_concern">mongoc_collection_set_read_concern</code>, and want to preserve an unaltered copy of the struct.</p>
31+
<p>This function does <em>not</em> copy the contents of the collection on the MongoDB server; use the <link href="https://docs.mongodb.org/manual/reference/command/cloneCollection/"><code>cloneCollection</code> command</link> for that purpose.</p>
32+
</section>
33+
34+
<section id="return">
35+
<title>Returns</title>
36+
<p>A newly allocated <code xref="mongoc_collection_t">mongoc_collection_t</code> that should be freed with <code xref="mongoc_collection_destroy">mongoc_collection_destroy()</code> when no longer in use.</p>
37+
</section>
38+
39+
</page>

doc/mongoc_database_copy.page

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0"?>
2+
<page xmlns="http://projectmallard.org/1.0/"
3+
type="topic"
4+
style="function"
5+
xmlns:api="http://projectmallard.org/experimental/api/"
6+
xmlns:ui="http://projectmallard.org/experimental/ui/"
7+
id="mongoc_database_copy">
8+
9+
<info>
10+
<link type="guide" xref="mongoc_database_t" group="function"/>
11+
</info>
12+
<title>mongoc_database_copy()</title>
13+
14+
<section id="synopsis">
15+
<title>Synopsis</title>
16+
<synopsis><code mime="text/x-csrc"><![CDATA[mongoc_database_t *
17+
mongoc_database_copy (mongoc_database_t *database);
18+
]]></code></synopsis>
19+
</section>
20+
21+
<section id="parameters">
22+
<title>Parameters</title>
23+
<table>
24+
<tr><td><p>database</p></td><td><p>A <code xref="mongoc_database_t">mongoc_database_t</code>.</p></td></tr>
25+
</table>
26+
</section>
27+
28+
<section id="description">
29+
<title>Description</title>
30+
<p>Performs a deep copy of the <code>database</code> struct and its configuration. Useful if you intend to call <code xref="mongoc_database_set_write_concern">mongoc_database_set_write_concern</code>, <code xref="mongoc_database_set_read_prefs">mongoc_database_set_read_prefs</code>, or <code xref="mongoc_database_set_read_concern">mongoc_database_set_read_concern</code>, and want to preserve an unaltered copy of the struct.</p>
31+
<p>This function does <em>not</em> copy the contents of the database on the MongoDB server; use the <link href="https://docs.mongodb.org/manual/reference/command/copydb/"><code>copydb</code> command</link> for that purpose.</p>
32+
</section>
33+
34+
<section id="return">
35+
<title>Returns</title>
36+
<p>A newly allocated <code xref="mongoc_database_t">mongoc_database_t</code> that should be freed with <code xref="mongoc_database_destroy">mongoc_database_destroy()</code> when no longer in use.</p>
37+
</section>
38+
39+
</page>

0 commit comments

Comments
 (0)