2 * BongoDB, an embedded document-based engine
3 * Copyright (C) 2015 by Javier Sancho Fernandez <jsf at jsancho dot org>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 struct bongo_record_tag_t *next;
32 bongo_record_tag_t *tags;
33 struct bongo_record_node_t *next;
34 } bongo_record_node_t;
39 bongo_record_node_t *records;
40 struct bongo_collection_node_t *next;
41 } bongo_collection_node_t;
46 bongo_collection_node_t *collections;
47 struct bongo_database_node_t *next;
48 } bongo_database_node_t;
52 bongo_database_node_t *databases;
56 bongo_client_new (void);
58 bongo_database_node_t *
59 bongo_database_node_new (bongo_client_t *client,
62 bongo_collection_node_t *
63 bongo_collection_node_new (bongo_database_node_t *database_node,
64 const char *col_name);
66 bongo_database_node_t *
67 bongo_database_node_search (bongo_client_t *client,
70 bongo_collection_node_t *
71 bongo_collection_node_search (bongo_database_node_t *database_node,
72 const char *col_name);
75 bongo_collection_node_destroy (bongo_collection_node_t *collection_node);
78 bongo_database_node_destroy (bongo_database_node_t *database_node);
81 bongo_client_destroy (bongo_client_t *client);
84 /* BongoDB Database */
87 bongo_database_node_t *database_node;
91 bongo_client_get_database (bongo_client_t *client,
95 bongo_database_destroy (bongo_database_t *database);
98 /* BongoDB Collection */
101 bongo_collection_node_t *collection_node;
102 } bongo_collection_t;
105 bongo_client_get_collection (bongo_client_t *client,
107 const char *col_name);
110 bongo_collection_insert (bongo_collection_t *collection,
111 bongo_insert_flags_t flags,
112 const char *document,
113 const bongo_write_concern_t *write_concern,
114 bongo_error_t *error);
117 bongo_collection_destroy (bongo_collection_t *collection);
120 #endif /* __BONGODB_H_ */