Skip to content

Commit bcf4c00

Browse files
committed
Improve mongoc_index docs
1 parent bc4ce3d commit bcf4c00

8 files changed

+251
-4
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
3+
<page xmlns="http://projectmallard.org/1.0/"
4+
type="topic"
5+
style="function"
6+
xmlns:api="http://projectmallard.org/experimental/api/"
7+
xmlns:ui="http://projectmallard.org/experimental/ui/"
8+
id="mongoc_index_opt_geo_get_default">
9+
10+
11+
<info>
12+
<link type="guide" xref="mongoc_index_opt_geo_t" group="function"/>
13+
</info>
14+
<title>mongoc_index_opt_geo_get_default()</title>
15+
16+
<section id="synopsis">
17+
<title>Synopsis</title>
18+
<synopsis><code mime="text/x-csrc"><![CDATA[const mongoc_index_opt_geo_t *
19+
mongoc_index_opt_geo_get_default (void) BSON_GNUC_CONST;
20+
]]></code></synopsis>
21+
22+
</section>
23+
24+
<section id="return">
25+
<title>Returns</title>
26+
<p>Returns a pointer to the default GEO index creation options.</p>
27+
</section>
28+
29+
30+
</page>

doc/mongoc_index_opt_geo_init.page

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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_index_opt_geo_init">
8+
<info>
9+
<link type="guide" xref="mongoc_index_opt_geo_t" group="function"/>
10+
</info>
11+
<title>mongoc_index_opt_geo_init()</title>
12+
13+
<section id="synopsis">
14+
<title>Synopsis</title>
15+
<synopsis><code mime="text/x-csrc"><![CDATA[void
16+
mongoc_index_opt_geo_init (mongoc_index_opt_geo_t *opt);
17+
]]></code></synopsis>
18+
</section>
19+
20+
<section id="parameters">
21+
<title>Parameters</title>
22+
<table>
23+
<tr><td><p>opt</p></td><td><p>A <code xref="mongoc_index_opt_geo_t">mongoc_index_opt_geo_t</code>.</p></td></tr>
24+
</table>
25+
</section>
26+
27+
<section id="description">
28+
<title>Description</title>
29+
<p>This function will initialize <code>opt</code> to the default values. It should be called before modifying any fields within the structure.</p>
30+
</section>
31+
32+
</page>

doc/mongoc_index_opt_geo_t.page

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0"?>
2+
3+
<page id="mongoc_index_opt_geo_t"
4+
type="guide"
5+
style="index"
6+
xmlns="http://projectmallard.org/1.0/"
7+
xmlns:api="http://projectmallard.org/experimental/api/"
8+
xmlns:ui="http://projectmallard.org/experimental/ui/">
9+
<info>
10+
<link type="guide" xref="index#api-reference" />
11+
</info>
12+
13+
<title>mongoc_index_opt_geo_t</title>
14+
15+
<section id="description">
16+
<title>Synopsis</title>
17+
<synopsis><code mime="text/x-csrc"><![CDATA[#include <mongoc.h>
18+
19+
typedef struct
20+
{
21+
uint8_t twod_sphere_version;
22+
uint8_t twod_bits_precision;
23+
double twod_location_min;
24+
double twod_location_max;
25+
double haystack_bucket_size;
26+
uint8_t *padding[32];
27+
} mongoc_index_opt_geo_t;]]></code></synopsis>
28+
</section>
29+
30+
<section id="desc">
31+
<title>Description</title>
32+
<p>This structure contains the options that may be used for tuning a GEO index.</p>
33+
34+
</section>
35+
36+
<links type="topic" groups="function" style="2column">
37+
<title>Functions</title>
38+
</links>
39+
40+
<section id="seealso">
41+
<title>See Also</title>
42+
<p><link type="seealso" xref="mongoc_index_opt_t"><code>mongoc_index_opt_t</code></link></p>
43+
<p><link type="seealso" xref="mongoc_index_opt_wt_t"><code>mongoc_index_opt_wt_t</code></link></p>
44+
</section>
45+
</page>

doc/mongoc_index_opt_init.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mongoc_index_opt_init (mongoc_index_opt_t *opt);
2020
<section id="parameters">
2121
<title>Parameters</title>
2222
<table>
23-
<tr><td><p>opt</p></td><td><p>A mongoc_index_opt_t.</p></td></tr>
23+
<tr><td><p>opt</p></td><td><p>A <code xref="mongoc_index_opt_t">mongoc_index_opt_t</code>.</p></td></tr>
2424
</table>
2525
</section>
2626

doc/mongoc_index_opt_t.page

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
<info>
1010
<link type="guide" xref="index#api-reference" />
1111
</info>
12+
1213
<title>mongoc_index_opt_t</title>
14+
1315
<section id="description">
1416
<title>Synopsis</title>
15-
<code mime="text/x-csrc"><![CDATA[#include <mongoc.h>
17+
<synopsis><code mime="text/x-csrc"><![CDATA[#include <mongoc.h>
1618
1719
typedef struct
1820
{
@@ -30,20 +32,55 @@ typedef struct
3032
mongoc_index_opt_geo_t *geo_options;
3133
mongoc_index_opt_storage_t *storage_options;
3234
void *padding[6];
33-
} mongoc_index_opt_t;]]></code>
35+
} mongoc_index_opt_t;]]></code></synopsis>
3436
</section>
3537

3638
<section id="desc">
3739
<title>Description</title>
3840
<p>This structure contains the options that may be used for tuning a specific index.</p>
3941

40-
<p>NOTE: dropDups is deprecated as of MongoDB version 2.7.5. This option is silently
42+
<p>NOTE: dropDups is deprecated as of MongoDB version 3.0.0. This option is silently
4143
ignored by the server and unique index builds using this option will fail if a duplicate
4244
value is detected.</p>
4345
</section>
4446

47+
<section id="example">
48+
<title>Example</title>
49+
<screen><code mime="text/x-csrc"><![CDATA[
50+
{
51+
bson_t keys;
52+
bson_error_t error;
53+
mongoc_index_opt_t opt;
54+
mongoc_index_opt_geo_t geo_opt;
55+
56+
mongoc_index_opt_init(&opt);
57+
mongoc_index_opt_geo_init(&geo_opt);
58+
59+
bson_init(&keys);
60+
BSON_APPEND_UTF8(&keys, "location", "2d");
61+
62+
geo_opt.twod_location_min = -123;
63+
geo_opt.twod_location_max = +123;
64+
geo_opt.twod_bits_precision = 30;
65+
opt.geo_options = &geo_opt;
66+
67+
collection = mongoc_client_get_collection (client, "test", "geo_test");
68+
if (mongoc_collection_create_index(collection, &keys, &opt, &error)) {
69+
/* Successfully created the geo index */
70+
}
71+
bson_destroy(&keys);
72+
mongoc_collection_destroy(&collection);
73+
}
74+
]]></code></screen>
75+
</section>
76+
4577
<links type="topic" groups="function" style="2column">
4678
<title>Functions</title>
4779
</links>
4880

81+
<section id="seealso">
82+
<title>See Also</title>
83+
<p><link type="seealso" xref="mongoc_index_opt_geo_t"><code>mongoc_index_opt_geo_t</code></link></p>
84+
<p><link type="seealso" xref="mongoc_index_opt_wt_t"><code>mongoc_index_opt_wt_t</code></link></p>
85+
</section>
4986
</page>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0"?>
2+
3+
<page xmlns="http://projectmallard.org/1.0/"
4+
type="topic"
5+
style="function"
6+
xmlns:api="http://projectmallard.org/experimental/api/"
7+
xmlns:ui="http://projectmallard.org/experimental/ui/"
8+
id="mongoc_index_opt_wt_get_default">
9+
10+
11+
<info>
12+
<link type="guide" xref="mongoc_index_opt_wt_t" group="function"/>
13+
</info>
14+
<title>mongoc_index_opt_wt_get_default()</title>
15+
16+
<section id="synopsis">
17+
<title>Synopsis</title>
18+
<synopsis><code mime="text/x-csrc"><![CDATA[const mongoc_index_opt_wt_t *
19+
mongoc_index_opt_wt_get_default (void) BSON_GNUC_CONST;
20+
]]></code></synopsis>
21+
22+
</section>
23+
24+
<section id="return">
25+
<title>Returns</title>
26+
<p>Returns a pointer to the default WiredTiger index creation options.</p>
27+
</section>
28+
29+
30+
</page>

doc/mongoc_index_opt_wt_init.page

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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_index_opt_wt_init">
8+
<info>
9+
<link type="guide" xref="mongoc_index_opt_wt_t" group="function"/>
10+
</info>
11+
<title>mongoc_index_opt_wt_init()</title>
12+
13+
<section id="synopsis">
14+
<title>Synopsis</title>
15+
<synopsis><code mime="text/x-csrc"><![CDATA[void
16+
mongoc_index_opt_wt_init (mongoc_index_opt_wt_t *opt);
17+
]]></code></synopsis>
18+
</section>
19+
20+
<section id="parameters">
21+
<title>Parameters</title>
22+
<table>
23+
<tr><td><p>opt</p></td><td><p>A <code xref="mongoc_index_opt_wt_t">mongoc_index_opt_wt_t</code>.</p></td></tr>
24+
</table>
25+
</section>
26+
27+
<section id="description">
28+
<title>Description</title>
29+
<p>This function will initialize <code>opt</code> to the default values. It should be called before modifying any fields within the structure.</p>
30+
</section>
31+
32+
</page>

doc/mongoc_index_opt_wt_t.page

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0"?>
2+
3+
<page id="mongoc_index_opt_wt_t"
4+
type="guide"
5+
style="class"
6+
xmlns="http://projectmallard.org/1.0/"
7+
xmlns:api="http://projectmallard.org/experimental/api/"
8+
xmlns:ui="http://projectmallard.org/experimental/ui/">
9+
<info>
10+
<link type="guide" xref="index#api-reference" />
11+
</info>
12+
13+
<title>mongoc_index_opt_wt_t</title>
14+
15+
<section id="description">
16+
<title>Synopsis</title>
17+
<synopsis><code mime="text/x-csrc"><![CDATA[#include <mongoc.h>
18+
19+
typedef struct
20+
{
21+
mongoc_index_opt_storage_t base;
22+
const char *config_str;
23+
void *padding[8];
24+
} mongoc_index_opt_wt_t;]]></code></synopsis>
25+
</section>
26+
27+
<section id="desc">
28+
<title>Description</title>
29+
<p>This structure contains the options that may be used for tuning a WiredTiger specific index.</p>
30+
</section>
31+
32+
<links type="topic" groups="function" style="2column">
33+
<title>Functions</title>
34+
</links>
35+
36+
<section id="seealso">
37+
<title>See Also</title>
38+
<p><link type="seealso" xref="mongoc_index_opt_t"><code>mongoc_index_opt_t</code></link></p>
39+
<p><link type="seealso" xref="mongoc_index_opt_geo_t"><code>mongoc_index_opt_wt_t</code></link></p>
40+
</section>
41+
</page>

0 commit comments

Comments
 (0)