Skip to content

Commit a6011b9

Browse files
author
Christian Hergert
committed
doc: add some database docs.
1 parent d26b2a1 commit a6011b9

File tree

3 files changed

+72
-5
lines changed

3 files changed

+72
-5
lines changed

doc/mongoc_database.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ SYNOPSIS
1414
---------------
1515
#include <mongoc.h>
1616

17-
mongoc_client_t * client;
18-
mongoc_database_t * database;
17+
{
18+
mongoc_database_t *database;
19+
mongoc_client_t *client;
1920

20-
client = mongoc_client_new(uri_string);
21-
22-
database = mongoc_client_get_database(client, "db_name");
21+
client = mongoc_client_new (uri_string);
22+
database = mongoc_client_get_database (client, "db_name");
23+
}
2324
---------------
2425

2526

@@ -57,6 +58,8 @@ linkmongoc:mongoc_database_command[3]
5758
linkmongoc:mongoc_database_command_simple[3]
5859
linkmongoc:mongoc_database_drop[3]
5960
linkmongoc:mongoc_database_has_collection[3]
61+
linkmongoc:mongoc_database_get_collection[3]
62+
linkmongoc:mongoc_database_get_name[3]
6063
linkmongoc:mongoc_database_get_read_prefs[3]
6164
linkmongoc:mongoc_database_set_read_prefs[3]
6265
linkmongoc:mongoc_database_get_write_concern[3]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
mongoc_database_get_collection(3)
2+
=================================
3+
4+
5+
NAME
6+
----
7+
8+
mongoc_database_get_collection - Fetch a collection within a database
9+
10+
11+
SYNOPSIS
12+
--------
13+
[source,c]
14+
-----------------------
15+
mongoc_collection_t *
16+
mongoc_database_get_collection (mongoc_database_t *database,
17+
const char *name);
18+
-----------------------
19+
20+
21+
DESCRIPTION
22+
-----------
23+
The _mongoc_database_get_collection()_ function shall return a newly
24+
allocated mongoc_collection_t for the collection named by _name_.
25+
26+
RETURN VALUE
27+
------------
28+
A _mongoc_collection_t_ that should be freed with mongoc_collection_destroy().
29+
30+
31+
AUTHORS
32+
-------
33+
This page was written by MongoDB, Inc.

doc/mongoc_database_get_name.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
mongoc_database_get_name(3)
2+
===========================
3+
4+
5+
NAME
6+
----
7+
8+
mongoc_database_get_name - Fetch the name of database
9+
10+
11+
SYNOPSIS
12+
--------
13+
[source,c]
14+
-----------------------
15+
const char *mongoc_database_get_name (mongoc_database_t *database);
16+
-----------------------
17+
18+
19+
DESCRIPTION
20+
-----------
21+
The _mongoc_database_get_name()_ function shall return a string containing
22+
the database name. This value should not be modified or freed.
23+
24+
RETURN VALUE
25+
------------
26+
A string which should not be modified or freed.
27+
28+
29+
AUTHORS
30+
-------
31+
This page was written by MongoDB, Inc.

0 commit comments

Comments
 (0)