|
libmongo-client 0.1.4
|
MongoDB synchronous wrapper API implementation. More...
#include "config.h"#include "mongo.h"#include "libmongo-private.h"#include <stdlib.h>#include <errno.h>#include <string.h>#include <unistd.h>
Go to the source code of this file.
Defines | |
| #define | _SLAVE_FLAG(c) ((c->slaveok) ? MONGO_WIRE_FLAG_QUERY_SLAVE_OK : 0) |
Functions | |
| mongo_sync_connection * | mongo_sync_connect (const gchar *host, gint port, gboolean slaveok) |
| Synchronously connect to a MongoDB server. | |
| gboolean | mongo_sync_conn_seed_add (mongo_sync_connection *conn, const gchar *host, gint port) |
| Add a seed to an existing MongoDB connection. | |
| mongo_sync_connection * | mongo_sync_reconnect (mongo_sync_connection *conn, gboolean force_master) |
| Attempt to connect to another member of a replica set. | |
| void | mongo_sync_disconnect (mongo_sync_connection *conn) |
| Close and free a synchronous MongoDB connection. | |
| gint32 | mongo_sync_conn_get_max_insert_size (mongo_sync_connection *conn) |
| Get the maximum size of a bulk insert package. | |
| gboolean | mongo_sync_conn_set_max_insert_size (mongo_sync_connection *conn, gint32 max_size) |
| Set the maximum size of a bulk insert package. | |
| gboolean | mongo_sync_conn_get_safe_mode (const mongo_sync_connection *conn) |
| Retrieve the state of the safe mode flag from a sync connection. | |
| gboolean | mongo_sync_conn_set_safe_mode (mongo_sync_connection *conn, gboolean safe_mode) |
| Set the safe mode flag on a sync connection. | |
| gboolean | mongo_sync_conn_get_auto_reconnect (const mongo_sync_connection *conn) |
| Get the state of the auto-reconnect flag from a sync connection. | |
| gboolean | mongo_sync_conn_set_auto_reconnect (mongo_sync_connection *conn, gboolean auto_reconnect) |
| Set the state of the auto-reconnect flag on a sync connection. | |
| gboolean | mongo_sync_conn_get_slaveok (const mongo_sync_connection *conn) |
| Retrieve the state of the SLAVE_OK flag from a sync connection. | |
| gboolean | mongo_sync_conn_set_slaveok (mongo_sync_connection *conn, gboolean slaveok) |
| Set the SLAVE_OK flag on a sync connection. | |
| gboolean | mongo_sync_cmd_update (mongo_sync_connection *conn, const gchar *ns, gint32 flags, const bson *selector, const bson *update) |
| Send an update command to MongoDB. | |
| gboolean | mongo_sync_cmd_insert_n (mongo_sync_connection *conn, const gchar *ns, gint32 n, const bson **docs) |
| Send an insert command to MongoDB. | |
| gboolean | mongo_sync_cmd_insert (mongo_sync_connection *conn, const gchar *ns,...) |
| Send an insert command to MongoDB. | |
| mongo_packet * | mongo_sync_cmd_query (mongo_sync_connection *conn, const gchar *ns, gint32 flags, gint32 skip, gint32 ret, const bson *query, const bson *sel) |
| Send a query command to MongoDB. | |
| mongo_packet * | mongo_sync_cmd_get_more (mongo_sync_connection *conn, const gchar *ns, gint32 ret, gint64 cursor_id) |
| Send a get more command to MongoDB. | |
| gboolean | mongo_sync_cmd_delete (mongo_sync_connection *conn, const gchar *ns, gint32 flags, const bson *sel) |
| Send a delete command to MongoDB. | |
| gboolean | mongo_sync_cmd_kill_cursors (mongo_sync_connection *conn, gint32 n,...) |
| Send a kill_cursors command to MongoDB. | |
| mongo_packet * | mongo_sync_cmd_custom (mongo_sync_connection *conn, const gchar *db, const bson *command) |
| Send a custom command to MongoDB. | |
| gdouble | mongo_sync_cmd_count (mongo_sync_connection *conn, const gchar *db, const gchar *coll, const bson *query) |
| Send a count() command to MongoDB. | |
| gboolean | mongo_sync_cmd_create (mongo_sync_connection *conn, const gchar *db, const gchar *coll, gint flags,...) |
| Create a new MongoDB collection. | |
| bson * | mongo_sync_cmd_exists (mongo_sync_connection *conn, const gchar *db, const gchar *coll) |
| Check whether a collection exists in MongoDB. | |
| gboolean | mongo_sync_cmd_drop (mongo_sync_connection *conn, const gchar *db, const gchar *coll) |
| Send a drop() command to MongoDB. | |
| gboolean | mongo_sync_cmd_get_last_error (mongo_sync_connection *conn, const gchar *db, gchar **error) |
| Get the last error from MongoDB. | |
| gboolean | mongo_sync_cmd_reset_error (mongo_sync_connection *conn, const gchar *db) |
| Reset the last error variable in MongoDB. | |
| gboolean | mongo_sync_cmd_is_master (mongo_sync_connection *conn) |
| Check whether the current node is the master. | |
| gboolean | mongo_sync_cmd_ping (mongo_sync_connection *conn) |
| Send a PING command to MongoDB. | |
| gboolean | mongo_sync_cmd_user_add (mongo_sync_connection *conn, const gchar *db, const gchar *user, const gchar *pw) |
| Add a user to MongoDB. | |
| gboolean | mongo_sync_cmd_user_remove (mongo_sync_connection *conn, const gchar *db, const gchar *user) |
| Remove a user from MongoDB. | |
| gboolean | mongo_sync_cmd_authenticate (mongo_sync_connection *conn, const gchar *db, const gchar *user, const gchar *pw) |
| Authenticate a user with MongoDB. | |
| gboolean | mongo_sync_cmd_index_create (mongo_sync_connection *conn, const gchar *ns, const bson *key, gint options) |
| Create an index. | |
| gboolean | mongo_sync_cmd_index_drop (mongo_sync_connection *conn, const gchar *ns, const bson *key) |
| Drop an index. | |
| gboolean | mongo_sync_cmd_index_drop_all (mongo_sync_connection *conn, const gchar *ns) |
| Drop all indexes from a namespace. | |
MongoDB synchronous wrapper API implementation.
Definition in file mongo-sync.c.
1.7.4