Package mongo-c-driver-devel

Header files and development libraries for mongo-c-driver

https://github.com/mongodb/mongo-c-driver

This package contains the header files and development libraries
for mongo-c-driver.

Documentation: http://api.mongodb.org/c/1.5.0/

Library Functions (Section 3)
mongoc_advanced_connections
Connecting to a replica set is much like connecting to a standalone MongoDB server. Simply specify the replica set name using the ?replicaSet=myreplset URI...
mongoc_aggregate
MongoDB , version 2.2.0 or later. MongoDB C driver , version 0.96.0 or later. Let's check if everything is installed. Use the following command to load...
mongoc_apm_callbacks_destroy
None
mongoc_apm_callbacks_new
None
mongoc_apm_callbacks_t
Used to receive notification of events, such as when a MongoDB command begins, succeeds, or fails. Create a mongoc_apm_callbacks_t with mongoc_apm_callbacks_new...
mongoc_apm_command_failed_get_command_name
None
mongoc_apm_command_failed_get_context
None
mongoc_apm_command_failed_get_duration
None
mongoc_apm_command_failed_get_error
None
mongoc_apm_command_failed_get_host
None
mongoc_apm_command_failed_get_operation_id
None
mongoc_apm_command_failed_get_request_id
None
mongoc_apm_command_failed_get_server_id
None
mongoc_apm_command_failed_t
An event notification sent when the driver fails to execute a MongoDB command.
mongoc_apm_command_started_get_command
None
mongoc_apm_command_started_get_command_name
None
mongoc_apm_command_started_get_context
None
mongoc_apm_command_started_get_database_name
None
mongoc_apm_command_started_get_host
None
mongoc_apm_command_started_get_operation_id
None
mongoc_apm_command_started_get_request_id
None
mongoc_apm_command_started_get_server_id
None
mongoc_apm_command_started_t
An event notification sent when the driver begins executing a MongoDB command.
mongoc_apm_command_succeeded_get_command_name
None
mongoc_apm_command_succeeded_get_context
None
mongoc_apm_command_succeeded_get_duration
None
mongoc_apm_command_succeeded_get_host
None
mongoc_apm_command_succeeded_get_operation_id
None
mongoc_apm_command_succeeded_get_reply
None
mongoc_apm_command_succeeded_get_request_id
None
mongoc_apm_command_succeeded_get_server_id
None
mongoc_apm_command_succeeded_t
An event notification sent when the driver successfully executes a MongoDB command.
mongoc_apm_server_changed_get_context
None
mongoc_apm_server_changed_get_host
None
mongoc_apm_server_changed_get_new_description
None
mongoc_apm_server_changed_get_previous_description
None
mongoc_apm_server_changed_get_topology_id
None
mongoc_apm_server_changed_t
An event notification sent when the driver observes a change in status of a server it is connected to.
mongoc_apm_server_closed_get_context
None
mongoc_apm_server_closed_get_host
None
mongoc_apm_server_closed_get_topology_id
None
mongoc_apm_server_closed_t
An event notification sent when the driver stops monitoring a server and removes its mongoc_server_description_t
mongoc_apm_server_heartbeat_failed_get_context
None
mongoc_apm_server_heartbeat_failed_get_duration
None
mongoc_apm_server_heartbeat_failed_get_error
None
mongoc_apm_server_heartbeat_failed_get_host
None
mongoc_apm_server_heartbeat_failed_t
An event notification sent when the driver failed to send an "isMaster" command to check the status of a server.
mongoc_apm_server_heartbeat_started_get_context
None
mongoc_apm_server_heartbeat_started_get_host
None
mongoc_apm_server_heartbeat_started_t
An event notification sent when the driver begins executing an "isMaster" command to check the status of a server.
mongoc_apm_server_heartbeat_succeeded_get_context
None
mongoc_apm_server_heartbeat_succeeded_get_duration
None
mongoc_apm_server_heartbeat_succeeded_get_host
None
mongoc_apm_server_heartbeat_succeeded_get_reply
None
mongoc_apm_server_heartbeat_succeeded_t
An event notification sent when the driver completes an "isMaster" command to check the status of a server.
mongoc_apm_server_opening_get_context
None
mongoc_apm_server_opening_get_host
None
mongoc_apm_server_opening_get_topology_id
None
mongoc_apm_server_opening_t
An event notification sent when the driver adds a mongoc_server_description_t for a new server it was not monitoring before.
mongoc_apm_set_command_failed_cb
None
mongoc_apm_set_command_started_cb
None
mongoc_apm_set_command_succeeded_cb
None
mongoc_apm_topology_changed_get_context
None
mongoc_apm_topology_changed_get_new_description
None
mongoc_apm_topology_changed_get_previous_description
None
mongoc_apm_topology_changed_get_topology_id
None
mongoc_apm_topology_changed_t
An event notification sent when the driver observes a change in any of the servers it is connected to or a change in the overall server topology.
mongoc_apm_topology_closed_get_context
None
mongoc_apm_topology_closed_get_topology_id
None
mongoc_apm_topology_closed_t
An event notification sent when the driver stops monitoring a server topology and destroys its mongoc_topology_description_t
mongoc_apm_topology_opening_get_context
None
mongoc_apm_topology_opening_get_topology_id
None
mongoc_apm_topology_opening_t
An event notification sent when the driver initializes a mongoc_topology_description_t
mongoc_application_performance_monitoring
None
mongoc_authentication
The MongoDB C driver supports challenge response authentication (sometimes known as MONGODB-CR ) through the use of MongoDB connection URIs. Simply provide the...
mongoc_basic_aggregate
None
mongoc_basic_troubleshooting
The following is a short list of things to check when you have a problem.
mongoc_bulk
First we need to fetch a bulk operation handle from the mongoc_collection_t
mongoc_bulk_operation_delete
None
mongoc_bulk_operation_delete_one
None
mongoc_bulk_operation_destroy
None
mongoc_bulk_operation_execute
None
mongoc_bulk_operation_get_hint
Retrieves the opaque id of the server used for the operation. (The function name includes the old term "hint" for the sake of backward compatibility, but we now...
mongoc_bulk_operation_get_write_concern
Fetches the write concern to be used for bulk
mongoc_bulk_operation_insert
None
mongoc_bulk_operation_remove
None
mongoc_bulk_operation_remove_many_with_opts
None
mongoc_bulk_operation_remove_one
None
mongoc_bulk_operation_remove_one_with_opts
None
mongoc_bulk_operation_replace_one
None
mongoc_bulk_operation_replace_one_with_opts
None
mongoc_bulk_operation_set_bypass_document_validation
Will bypass document validation for all operations part of this bulk
mongoc_bulk_operation_set_hint
Specifies which server to use for the operation. This function has an effect only if called before mongoc_bulk_operation_execute (The function name includes the...
mongoc_bulk_operation_t
Bulk Write Operations
mongoc_bulk_operation_update
None
mongoc_bulk_operation_update_many_with_opts
None
mongoc_bulk_operation_update_one
None
mongoc_bulk_operation_update_one_with_opts
None
mongoc_check_version
None
mongoc_cleanup
This function is responsible for cleaning up after use of the MongoDB C driver. It will release any lingering allocated memory which can be useful when running...
mongoc_client_command
None
mongoc_client_command_simple
None
mongoc_client_command_simple_with_server_id
None
mongoc_client_destroy
None
mongoc_client_get_collection
None
mongoc_client_get_database
None
mongoc_client_get_database_names
None
mongoc_client_get_default_database
None
mongoc_client_get_gridfs
None
mongoc_client_get_max_bson_size
None
mongoc_client_get_max_message_size
None
mongoc_client_get_read_concern
None
mongoc_client_get_read_prefs
None
mongoc_client_get_server_description
None
mongoc_client_get_server_descriptions
None
mongoc_client_get_server_status
None
mongoc_client_get_uri
None
mongoc_client_get_write_concern
None
mongoc_client_new
None
mongoc_client_new_from_uri
None
mongoc_client_pool_destroy
None
mongoc_client_pool_max_size
None
mongoc_client_pool_min_size
None
mongoc_client_pool_new
None
mongoc_client_pool_pop
None
mongoc_client_pool_push
None
mongoc_client_pool_set_apm_callbacks
None
mongoc_client_pool_set_appname
None
mongoc_client_pool_set_error_api
None
mongoc_client_pool_set_ssl_opts
None
mongoc_client_pool_t
Connection pooling abstraction
mongoc_client_pool_try_pop
None
mongoc_client_read_command_with_opts
None
mongoc_client_read_write_command_with_opts
None
mongoc_client_select_server
None
mongoc_client_set_apm_callbacks
None
mongoc_client_set_appname
None
mongoc_client_set_error_api
None
mongoc_client_set_read_concern
None
mongoc_client_set_read_prefs
None
mongoc_client_set_ssl_opts
None
mongoc_client_set_stream_initiator
None
mongoc_client_set_write_concern
None
mongoc_client_t
MongoDB Connection Abstraction
mongoc_client_write_command_with_opts
None
mongoc_collection_aggregate
This function shall execute an aggregation query on the underlying 'collection'. The bson 'pipeline' is not validated, simply passed along as appropriate to the...
mongoc_collection_command
None
mongoc_collection_command_simple
This is a simplified version of mongoc_collection_command(3) that returns the first result document in reply reply is initialized even upon failure to simplify...
mongoc_collection_copy
Performs a deep copy of the collection struct and its configuration. Useful if you intend to call mongoc_collection_set_write_concern ...
mongoc_collection_count
This function shall execute a count query on the underlying 'collection'. The bson 'query' is not validated, simply passed along as appropriate to the server...
mongoc_collection_count_with_opts
This function shall execute a count query on the underlying 'collection'. The bson 'query' is not validated, simply passed along as appropriate to the server...
mongoc_collection_create_bulk_operation
This function shall begin a new bulk operation. After creating this you may call various functions such as mongoc_bulk_operation_update(3) ...
mongoc_collection_create_index
For more information, see mongoc_collection_create_index_with_opts(3) NULL in as mongoc_write_concern_t parameter. This function also creates a local bson_t to...
mongoc_collection_create_index_with_opts
This function will request the creation of a new index. This function will use the createIndexes command if available on the MongoDB server. If not, it will...
mongoc_collection_delete
This function shall delete documents in the given collection that match selector selector is not validated, simply passed along as appropriate to the server. As...
mongoc_collection_destroy
This function shall destroy a mongoc_collection_t and its associated resources. NOTE
mongoc_collection_drop
For more information, see mongoc_collection_drop_with_opts(3) NULL in as opts parameter.
mongoc_collection_drop_index
For more information, see mongoc_collection_drop_with_opts(3) NULL in as opts parameter.
mongoc_collection_drop_index_with_opts
This function requests than an index on collection be dropped. In the event of an error it returns false and error is set. If no write concern is provided in...
mongoc_collection_drop_with_opts
This function requests that a collection be dropped, including all indexes associated with the collection If no write concern is provided in opts , the...
mongoc_collection_ensure_index
None
mongoc_collection_find
This function shall execute a query on the underlying collection If no options are necessary, query can simply contain a query such as {a:1} {"$query": {}}...
mongoc_collection_find_and_modify
Update and return an object. This is a thin wrapper around the findAndModify command. Either update or _remove arguments are required. See also...
mongoc_collection_find_and_modify_with_opts
Update and return an object.
mongoc_collection_find_indexes
None
mongoc_collection_find_with_opts
Query on collection , passing arbitrary query options to the server in opts To target a specific server, include an integer "serverId" field in opts with an id...
mongoc_collection_get_last_error
The mongoc_collection_get_last_error() function returns a bulk result. See Bulk Write Operations for examples of bulk results. A write_concern must be at least...
mongoc_collection_get_name
Fetches the name of collection
mongoc_collection_get_read_concern
Fetches the default read concern to be used on read operations originating from collection
mongoc_collection_get_read_prefs
Fetches the default read preferences to use for collection
mongoc_collection_get_write_concern
Fetches the default write concern to be used on write operations originating from collection and not specifying a write concern.
mongoc_collection_insert
This function shall insert document into collection If no _id element is found in document , then a bson_oid_t will be generated locally and added to the...
mongoc_collection_insert_bulk
This function performs a bulk insert of all of the documents in documents
mongoc_collection_keys_to_index_string
This function shall returns the canonical stringification, as used in mongoc_collection_create_index(3) without an explicit name, of a given key specification...
mongoc_collection_read_command_with_opts
None
mongoc_collection_read_write_command_with_opts
None
mongoc_collection_remove
This function shall remove documents in the given collection that match selector selector is not validated, simply passed along as appropriate to the server. As...
mongoc_collection_rename
For more information, see mongoc_collection_rename_with_opts(3) NULL in as opts parameter.
mongoc_collection_rename_with_opts
This function is a helper to rename an existing collection on a MongoDB server. The name of the collection will also be updated internally so it is safe to...
mongoc_collection_save
This function shall save a document into collection _id field it will be updated. Otherwise it will be inserted.
mongoc_collection_set_read_concern
Sets the read concern to use for operations on collection The default read concern is empty: No readConcern is sent to the server unless explicitly configured.
mongoc_collection_set_read_prefs
Sets the default read preferences to use for operations on collection not specifying a read preference. The global default is MONGOC_READ_PRIMARY: if the client...
mongoc_collection_set_write_concern
Sets the write concern to use for operations on collection The default write concern is MONGOC_WRITE_CONCERN_W_DEFAULT: the driver blocks awaiting basic...
mongoc_collection_stats
Run the collStats command to retrieve statistics about the collection. The command uses the mongoc_read_prefs_t set on collection
mongoc_collection_t
#include <mongoc.h> typedef struct _mongoc_collection_t mongoc_collection_t;
mongoc_collection_update
This function shall update documents in collection that match selector By default, updates only a single document. Set flags to MONGOC_UPDATE_MULTI_UPDATE to...
mongoc_collection_validate
This function is a helper function to execute the validate MongoDB command. Currently, the only supported options are full , which is a boolean and scandata ...
mongoc_collection_write_command_with_opts
None
mongoc_common_task_examples
None Drivers for some other languages provide helper functions to perform certain common tasks. In the C Driver we must explicitly build commands to send to the...
mongoc_cursor_clone
This function shall create a copy of a mongoc_cursor_t mongoc_cursor_next(3) is called.
mongoc_cursor_current
Fetches the cursors current document or NULL if there has been an error.
mongoc_cursor_destroy
Frees a mongoc_cursor_t and releases all associated resources. If a server‐side cursor has been allocated, it will be released as well.
mongoc_cursor_error
This function checks to see if an error has occurred while iterating the cursor.
mongoc_cursor_get_batch_size
Retrieve the cursor's batch size, the maximum number of documents returned per round trip to the server. A batch size of zero means the cursor accepts the...
mongoc_cursor_get_hint
Retrieves the opaque id of the server used for the operation. (The function name includes the old term "hint" for the sake of backward compatibility, but we now...
mongoc_cursor_get_host
Fetches the MongoDB host that the cursor is communicating with in the host out parameter.
mongoc_cursor_get_id
Retrieves the cursor id used by the server to track the cursor. This number is zero until the driver actually uses a server when executing the query, and after...
mongoc_cursor_get_limit
Return the value set with mongoc_cursor_set_limit or mongoc_collection_find
mongoc_cursor_get_max_await_time_ms
Retrieve the value set with mongoc_cursor_set_max_await_time_ms
mongoc_cursor_is_alive
Checks to see if a cursor is in a state that allows for more documents to be queried. This is primarily useful with tailable cursors.
mongoc_cursor_more
This function shall indicate if there is potentially more data to be read from the cursor. This is only useful with tailable cursors. Use mongoc_cursor_next for...
mongoc_cursor_new_from_command_reply
Some MongoDB commands return a "cursor" document.
mongoc_cursor_next
This function shall iterate the underlying cursor, setting bson to the next document. This function is a blocking function.
mongoc_cursors
Cursors exist on a MongoDB server. However, the mongoc_cursor_t structure gives the local process a handle to the cursor. It is possible for errors to occur on...
mongoc_cursor_set_batch_size
Limits the number of documents returned in one batch. Each batch requires a round trip to the server. If the batch size is zero, the cursor uses the...
mongoc_cursor_set_hint
Specifies which server to use for the operation. This function has an effect only if called before the find operation is executed. (The function name includes...
mongoc_cursor_set_limit
Limits the number of documents in the result set. This function is useful for setting the limit on a cursor after the cursor is created, but before any calls to...
mongoc_cursor_set_max_await_time_ms
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Only applies if the cursor is created from...
mongoc_cursor_t
Client-side cursor abtraction
mongoc_database_add_user
This function shall create a new user with access to database.
mongoc_database_command
None
mongoc_database_command_simple
This is a simplified interface to mongoc_database_command() that returns the first result document. The database's read preference, read concern, and write...
mongoc_database_copy
Performs a deep copy of the database struct and its configuration. Useful if you intend to call mongoc_database_set_write_concern ...
mongoc_database_create_collection
This function creates a mongoc_collection_t from the given mongoc_database_t NOTE
mongoc_database_destroy
void mongoc_database_destroy (mongoc_database_t *database);
mongoc_database_drop
For more information, see mongoc_database_drop_with_opts(3) NULL in as opts parameter.
mongoc_database_drop_with_opts
This function attempts to drop a database on the MongoDB server. If no write concern is provided in command_opts , the database's write concern is used.
mongoc_database_find_collections
None
mongoc_database_get_collection
None
mongoc_database_get_collection_names
None
mongoc_database_get_name
None
mongoc_database_get_read_concern
None
mongoc_database_get_read_prefs
None
mongoc_database_get_write_concern
None
mongoc_database_has_collection
None
mongoc_database_read_command_with_opts
None
mongoc_database_read_write_command_with_opts
None
mongoc_database_remove_all_users
None
mongoc_database_remove_user
None
mongoc_database_set_read_concern
None
mongoc_database_set_read_prefs
None
mongoc_database_set_write_concern
None
mongoc_database_t
typedef struct _mongoc_database_t mongoc_database_t; mongoc_database_t provides access to a MongoDB database. This handle is useful for actions a particular...
mongoc_database_write_command_with_opts
None
mongoc_delete_flags_t
Flags for deletion operations
mongoc_deleting_document
This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
mongoc_errors
Many C Driver functions report errors by returning false or ‐1 and filling out a bson_error_t structure with an error domain, error code, and message. Use...
mongoc_executing_command
This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
mongoc_find_and_modify_opts_append
Adds arbitrary options to a findAndModify command. extra does not have to remain valid after calling this function.
mongoc_find_and_modify_opts_destroy
Frees all resources associated with the find and modify builder structure.
mongoc_find_and_modify_opts_new
None
mongoc_find_and_modify_opts_set_bypass_document_validation
Adds bypassDocumentValidation argument to the builder. NOTE
mongoc_find_and_modify_opts_set_fields
Adds fields argument to the builder. fields does not have to remain valid after calling this function.
mongoc_find_and_modify_opts_set_flags
Adds one or more flags to the builder.
mongoc_find_and_modify_opts_set_max_time_ms
Adds a maxTimeMS argument to the builder.
mongoc_find_and_modify_opts_set_sort
Adds sort argument to the builder. sort does not have to remain valid after calling this function.
mongoc_find_and_modify_opts_set_update
Adds update argument to the builder. update does not have to remain valid after calling this function.
mongoc_find_and_modify_opts_t
mongoc_find_and_modify_opts_t is a builder interface to construct a find_and_modify command. It was created to be able to accommodate new arguments to the...
mongoc_finding_document
This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
mongoc_get_major_version
None
mongoc_get_micro_version
None
mongoc_get_minor_version
None
mongoc_get_version
None
mongoc_gridfs_create_file
This function shall create a new mongoc_gridfs_file_t Use mongoc_gridfs_file_writev(3) to write to the file.
mongoc_gridfs_create_file_from_stream
This function shall create a new mongoc_gridfs_file_t and fill it with the contents of stream stream until End of File, making it bet suited for file‐backed...
mongoc_gridfs_destroy
This function shall destroy the gridfs structure referenced by gridfs and any resources associated with the gridfs.
mongoc_gridfs_drop
Requests that an entire GridFS be dropped, including all files associated with it.
mongoc_gridfs_file_destroy
Destroys the mongoc_gridfs_file_t instance and any resources associated with it.
mongoc_gridfs_file_error
This function checks to see if there has been an error associated with the last operation upon file
mongoc_gridfs_file_get_aliases
Fetches the aliases associated with a gridfs file.
mongoc_gridfs_file_get_chunk_size
Fetches the chunk size used with the underlying gridfs file.
mongoc_gridfs_file_get_content_type
Fetches the content type specified for the underlying file.
mongoc_gridfs_file_get_filename
Fetches the filename for the given gridfs file.
mongoc_gridfs_file_get_id
Fetches the id of a gridfs file. The C Driver always uses an ObjectId for _id , but files created by other drivers may have any type of _id
mongoc_gridfs_file_get_length
Fetches the length of the gridfs file in bytes.
mongoc_gridfs_file_get_md5
Fetches the pre‐computed MD5 for the underlying gridfs file.
mongoc_gridfs_file_get_metadata
Fetches a bson document containing the metadata for the gridfs file.
mongoc_gridfs_file_get_upload_date
Fetches the specified upload date of the gridfs file in milliseconds since the UNIX epoch.
mongoc_gridfs_file_list_destroy
Frees a mongoc_gridfs_file_list_t and releases any associated resources.
mongoc_gridfs_file_list_error
Fetches any error that has occurred while trying to retrieve the file list.
mongoc_gridfs_file_list_next
This function shall iterate the underlying gridfs file list, returning the next file each iteration. This is a blocking function.
mongoc_gridfs_file_list_t
mongoc_gridfs_file_list_t provides a gridfs file list abstraction. It provides iteration and basic marshalling on top of a regular...
mongoc_gridfs_file_opt_t
This structure contains options that can be set on a mongoc_gridfs_file_t
mongoc_gridfs_file_readv
This function performs a scattered read from file , potentially blocking to read from the MongoDB server. The timeout_msec parameter is unused.
mongoc_gridfs_file_remove
Removes file and its data chunks from the MongoDB server.
mongoc_gridfs_file_save
Saves modifications to file to the MongoDB server. If an error occurred, false is returned and the error can be retrieved with mongoc_gridfs_file_error(3)
mongoc_gridfs_file_seek
Adjust the file position pointer in the given file by delta, starting from the position whence. The whence argument is interpreted as in fseek(2):
mongoc_gridfs_file_set_aliases
Sets the aliases for a gridfs file. You need to call mongoc_gridfs_file_save(3) to persist this change.
mongoc_gridfs_file_set_content_type
Sets the content type for the gridfs file. This should be something like text/plain You need to call mongoc_gridfs_file_save(3) to persist this change.
mongoc_gridfs_file_set_filename
Sets the filename for file You need to call mongoc_gridfs_file_save(3) to persist this change.
mongoc_gridfs_file_set_id
Sets the id of file to any BSON type. If an error occurred, false is returned.
mongoc_gridfs_file_set_md5
Sets the MD5 checksum for file You need to call mongoc_gridfs_file_save(3) to persist this change.
mongoc_gridfs_file_set_metadata
Sets the metadata associated with file You need to call mongoc_gridfs_file_save(3) to persist this change.
mongoc_gridfs_file_t
This structure provides a MongoDB GridFS file abstraction. It provides several APIs.
mongoc_gridfs_file_tell
This function returns the current position indicator within file
mongoc_gridfs_file_writev
Performs a gathered write to the underlying gridfs file. The timeout_msec parameter is unused.
mongoc_gridfs_find
Finds all gridfs files matching query
mongoc_gridfs_find_one
This function shall execute a query on the underlying gridfs implementation. The first file matching query will be returned.
mongoc_gridfs_find_one_by_filename
Finds the first file matching the filename specified. If no file could be found, NULL is returned and error is set.
mongoc_gridfs_find_one_with_opts
Find the first GridFS file matching filter See mongoc_collection_find_with_opts for a description of the filter and opts parameters.
mongoc_gridfs_find_with_opts
Finds all gridfs files matching filter See mongoc_collection_find_with_opts for a description of the filter and opts parameters.
mongoc_gridfs_get_chunks
Returns a mongoc_collection_t that contains the chunks for files. This instance is owned by the mongoc_gridfs_t instance and should not be modified or freed.
mongoc_gridfs_get_files
Retrieves the mongoc_collection_t containing the file metadata for GridFS. This instance is owned by the mongoc_gridfs_t and should not be modified or freed.
mongoc_gridfs_remove_by_filename
Removes all files matching filename and their data chunks from the MongoDB server.
mongoc_gridfs_t
mongoc_gridfs_t provides a MongoDB gridfs implementation. The system as a whole is made up of gridfs objects, which contain gridfs_files and gridfs_file_lists...
mongoc_host_list_t
The host and port of a MongoDB server. Can be part of a linked list: for example the return value of mongoc_uri_get_hosts when multiple hosts are provided in...
mongoc_index
The MongoDB C Driver, also known as "libmongoc", is a library for using MongoDB from C applications, and for writing MongoDB drivers in higher‐level languages...
mongoc_index_opt_geo_get_default
None
mongoc_index_opt_geo_init
This function will initialize opt to the default values. It should be called before modifying any fields within the structure.
mongoc_index_opt_geo_t
This structure contains the options that may be used for tuning a GEO index.
mongoc_index_opt_get_default
None
mongoc_index_opt_init
This function will initialize opt to the default values. It should be called before modifying any fields within the structure.
mongoc_index_opt_t
This structure contains the options that may be used for tuning a specific index. See the createIndexes documentations in the MongoDB manual for descriptions of...
mongoc_index_opt_wt_get_default
None
mongoc_index_opt_wt_init
This function will initialize opt to the default values. It should be called before modifying any fields within the structure.
mongoc_index_opt_wt_t
This structure contains the options that may be used for tuning a WiredTiger specific index.
mongoc_init
This function should be called at the beginning of every program using the MongoDB C driver. It is responsible for initializing global state such as process...
mongoc_init_cleanup
The MongoDB C driver must be initialized using mongoc_init before use, and cleaned up with mongoc_cleanup before exiting. Failing to call these functions is a...
mongoc_insert_flags_t
These flags correspond to the MongoDB wire protocol. They may be bitwise or'd together. They may modify how an insert happens on the MongoDB server.
mongoc_inserting_document
This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
mongoc_installing
None
mongoc_iovec_t
Synopsis #include <mongoc.h> #ifdef _WIN32 typedef struct { u_long iov_len; char *iov_base; } mongoc_iovec_t; #else typedef struct iovec mongoc_iovec_t; #endif
mongoc_logging
MongoDB C driver Logging Abstraction
mongoc_matcher
None
mongoc_matcher_destroy
None
mongoc_matcher_match
None
mongoc_matcher_new
None
mongoc_matcher_t
Client-side document matching abstraction
mongoc_query_flags_t
These flags correspond to the MongoDB wire protocol. They may be bitwise or'd together. They may modify how a query is performed in the MongoDB server.
mongoc_rand
The mongoc_rand family of functions provide access to the low level randomness primitives used by the MongoDB C Driver. In particular, they control the creation...
mongoc_rand_add
Mixes num bytes of data into the mongoc random number generator. Entropy specifies a lower bound estimate of the randomness contained in buf.
mongoc_rand_seed
Seeds the mongoc random number generator with num bytes of entropy.
mongoc_rand_status
The status of the mongoc random number generator.
mongoc_read_concern_append
This function appends a read concern to command options. It is useful for appending a read concern to command options before passing them to...
mongoc_read_concern_copy
Performs a deep copy of read_concern
mongoc_read_concern_destroy
Frees all resources associated with the read concern structure.
mongoc_read_concern_get_level
Returns the currently set read concern.
mongoc_read_concern_new
None
mongoc_read_concern_set_level
The readConcern option allows clients to choose a level of isolation for their reads.
mongoc_read_concern_t
Read Concern abstraction
mongoc_read_mode_t
This enum describes how reads should be dispatched. The default is MONGOC_READ_PRIMARY. Please see the MongoDB website for a description of Read Preferences
mongoc_read_prefs_add_tag
This function shall add a tag to a read preference.
mongoc_read_prefs_copy
This function shall deep copy a read preference.
mongoc_read_prefs_destroy
Frees a read preference and all associated resources.
mongoc_read_prefs_get_max_staleness_seconds
Clients estimate the staleness of each secondary, and select for reads only those secondaries whose estimated staleness is less than or equal to...
mongoc_read_prefs_get_mode
Fetches the mongoc_read_mode_t for the read preference.
mongoc_read_prefs_get_tags
Fetches any read preference tags that have been registered.
mongoc_read_prefs_is_valid
Performs a consistency check of read_prefs to ensure it makes sense and can be satisfied. This only performs local consistency checks.
mongoc_read_prefs_new
Creates a new mongoc_read_prefs_t using the mode specified.
mongoc_read_prefs_set_max_staleness_seconds
Sets the maxStalenessSeconds to be used for the read preference. Clients estimate the staleness of each secondary, and select for reads only those secondaries...
mongoc_read_prefs_set_mode
Sets the read preference mode. See the MongoDB website for more information on Read Preferences
mongoc_read_prefs_set_tags
Sets the tags to be used for the read preference. Only mongod instances matching these tags will be suitable for handling the request.
mongoc_read_prefs_t
mongoc_read_prefs_t provides an abstraction on top of the MongoDB connection read prefences. It allows for hinting to the driver which nodes in a replica set...
mongoc_remove_flags_t
These flags correspond to the MongoDB wire protocol. They may be bitwise or'd together. They may change the number of documents that are removed during a remove...
mongoc_reply_flags_t
These flags correspond to the wire protocol. They may be bitwise or'd together.
mongoc_server_description_destroy
Clean up all memory associated with the server description.
mongoc_server_description_host
Return the server's host and port. This object is owned by the server description.
mongoc_server_description_id
Get the server's id, an opaque identifier generated by the client or client pool.
mongoc_server_description_ismaster
The client or client pool periodically runs an isMaster command on each server, to update its view of the MongoDB deployment. Use...
mongoc_server_description_new_copy
This function copies the given server description and returns a new server description object. The caller is responsible for destroying the new copy.
mongoc_server_description_round_trip_time
Get the server's round trip time in milliseconds. This is the client's measurement of the duration of an "ismaster" command.
mongoc_server_descriptions_destroy_all
None
mongoc_server_description_t
Server description
mongoc_server_description_type
This function returns a string, one of the server types defined in the Server Discovery And Monitoring Spec:
mongoc_socket_accept
This function is a wrapper around the BSD socket accept(3) interface. It allows for more portability between UNIX‐like and Microsoft Windows platforms.
mongoc_socket_bind
This function is a wrapper around the BSD socket bind(3) interface. It provides better portability between UNIX‐like and Microsoft Windows platforms.
mongoc_socket_close
This function is a wrapper around the BSD socket shutdown(3) interface. It provides better portability between UNIX‐like and Microsoft Windows platforms.
mongoc_socket_connect
This function is a wrapper around the BSD socket connect(3) interface. It provides better portability between UNIX‐like and Microsoft Windows platforms. This...
mongoc_socket_destroy
This function releases all resources associated with a mongoc_socket_t
mongoc_socket_errno
This function returns the currently captured errno for a socket. This may be useful to check was the last errno was after another function call has been made...
mongoc_socket_getnameinfo
This is a helper around getting the local name of a socket. It is a wrapper around getpeername(3) and getnameinfo(3)
mongoc_socket_getsockname
Retrieves the socket name for sock addr addrlen should be the size of the addr when calling this.
mongoc_socket_listen
This function is similar to the BSD sockets listen(3) function. It is meant for socket servers.
mongoc_socket_new
Creates a new mongoc_socket_t structure. This calls socket(3) underneath to create a network socket.
mongoc_socket_recv
This function performs a recv(3) on the underlying socket.
mongoc_socket_send
Sends buflen bytes in buf to the destination. If a timeout expired, the number of bytes sent will be returned or ‐1 if no bytes were sent.
mongoc_socket_sendv
Sends a vector of buffers to the destination. This uses sendmsg(3) when available to perform a gathered write. If IOV_MAX is reached, a fallback will be used.
mongoc_socket_setsockopt
This is a helper function for setsockopt(3)
mongoc_socket_t
Portable socket abstraction
mongoc_ssl_opt_get_default
None
mongoc_ssl_opt_t
This structure is used to set the SSL options for a mongoc_client_t or mongoc_client_pool_t Beginning in version 1.2.0, once a pool or client has any SSL...
mongoc_stream_buffered_new
This function shall create a new mongoc_stream_t that buffers bytes to and from the underlying base_stream.
mongoc_stream_buffered_t
mongoc_stream_buffered_t should be considered a subclass of mongoc_stream_t
mongoc_stream_close
This function shall close underlying file-descriptors of stream.
mongoc_stream_cork
This function shall prevent the writing of bytes to the underlying socket.
mongoc_stream_destroy
This function shall release all resources associated with a mongoc_stream_t, including freeing the structure. It is invalid to use stream after calling this...
mongoc_stream_file_get_fd
This function shall return the underlying file-descriptor of a mongoc_stream_file_t.
mongoc_stream_file_new
Creates a new mongoc_stream_file_t using the file-descriptor provided.
mongoc_stream_file_new_for_path
This function shall create a new mongoc_stream_file_t after opening the underlying file with open() or the platform equivalent.
mongoc_stream_file_t
typedef struct _mongoc_stream_file_t mongoc_stream_file_t
mongoc_stream_flush
This function shall flush any buffered bytes in the underlying stream to the physical transport. It mimics the API and semantics of fflush(), forcing a write of...
mongoc_stream_get_base_stream
This function shall fetch the underlying stream for streams that wrap a base stream. Such implementations include mongoc_stream_buffered_t and...
mongoc_stream_gridfs_new
This function shall create a new mongoc_gridfs_file_t. This function does not transfer ownership of file. Therefore, file must remain valid for the lifetime of...
mongoc_stream_gridfs_t
typedef struct _mongoc_stream_gridfs_t mongoc_stream_gridfs_t
mongoc_stream_read
The mongoc_stream_read() function shall perform a read from a mongoc_stream_t. It's modeled on the API and semantics of read(), though the parameters map only...
mongoc_stream_readv
This function is identical to mongoc_stream_read() except that it takes a mongoc_iovec_t to perform gathered I/O.
mongoc_stream_setsockopt
This function is a wrapper around setsockopt() for streams that wrap sockets.
mongoc_stream_socket_get_socket
Retrieves the underlying mongoc_socket_t for a mongoc_stream_socket_t.
mongoc_stream_socket_new
Creates a new mongoc_stream_socket_t using the mongoc_socket_t provided.
mongoc_stream_socket_t
typedef struct _mongoc_stream_socket_t mongoc_stream_socket_t
mongoc_stream_t
typedef struct _mongoc_stream_t mongoc_stream_t
mongoc_stream_tls_t
typedef struct _mongoc_stream_tls_t mongoc_stream_tls_t
mongoc_stream_uncork
This function shall allow a previously corked socket to pass bytes to the underlying socket.
mongoc_stream_write
The mongoc_stream_write() function shall perform a write to a mongoc_stream_t. It's modeled on the API and semantics of write(), though the parameters map only...
mongoc_stream_writev
The mongoc_stream_writev() function shall perform a write to a mongoc_stream_t. It's modeled on the API and semantics of writev(), though the parameters map...
mongoc_topology_description_get_servers
None
mongoc_topology_description_has_readable_server
None
mongoc_topology_description_has_writable_server
None
mongoc_topology_description_t
Status of MongoDB Servers
mongoc_topology_description_type
This function returns a string, one of the topology types defined in the Server Discovery And Monitoring Spec:
mongoc_tutorial
For detailed instructions on installing the MongoDB C Driver on a particular platform, please see the installation guide
mongoc_update_flags_t
These flags correspond to the MongoDB wire protocol. They may be bitwise or'd together. The allow for modifying the way an update is performed in the MongoDB...
mongoc_updating_document
This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.
mongoc_uri_copy
Copies the entire contents of a URI.
mongoc_uri_destroy
Frees all resources associated with a uri.
mongoc_uri_get_auth_mechanism
Fetches the authMechanism parameter to an URI if provided.
mongoc_uri_get_auth_source
Fetches the authSource parameter of an URI if provided.
mongoc_uri_get_database
Fetches the database portion of an URI if provided. This is the portion after the / but before the ?
mongoc_uri_get_hosts
Fetches a linked list of hosts that were defined in the URI (the comma‐separated host section).
mongoc_uri_get_option_as_bool
Returns the value of the URI option if it is set and of the correct type (bool). If not set, or set to an invalid type, returns fallback
mongoc_uri_get_option_as_int32
Returns the value of the URI option if it is set and of the correct type (int32). Returns fallback if the option is not set, set to an invalid type, or zero...
mongoc_uri_get_option_as_utf8
Returns the value of the URI option if it is set and of the correct type (string). This value is a pointer into the URI's internal buffer, and is only valid...
mongoc_uri_get_options
Fetches a bson document containing all of the options provided after the ? of a URI.
mongoc_uri_get_password
Fetches the password portion of an URI.
mongoc_uri_get_read_concern
Fetches a read concern that is owned by the URI instance. This read concern is configured based on URI parameters.
mongoc_uri_get_read_prefs
Fetches a bson document containing read preference tag information from a URI. Note that this does not include the read preference mode.
mongoc_uri_get_read_prefs_t
Fetches a read preference that is owned by the URI instance. This read preference concern is configured based on URI parameters.
mongoc_uri_get_replica_set
Fetches the replicaSet parameter of an URI.
mongoc_uri_get_ssl
Fetches a boolean indicating if SSL was specified for use in the URI.
mongoc_uri_get_string
Fetches the URI as a string.
mongoc_uri_get_username
Fetches the username portion of a URI.
mongoc_uri_get_write_concern
Fetches a write concern that is owned by the URI instance. This write concern is configured based on URI parameters.
mongoc_uri_new
Parses a string containing a MongoDB style URI connection string.
mongoc_uri_new_for_host_port
Creates a new mongoc_uri_t based on the hostname and port provided.
mongoc_uri_option_is_bool
Returns true if the option is a known MongoDB URI option of boolean type. For example, "ssl=false" is a valid MongoDB URI option, so mongoc_uri_option_is_bool...
mongoc_uri_option_is_int32
Returns true if the option is a known MongoDB URI option of integer type. For example, "socketTimeoutMS=100" is a valid MongoDB URI option, so...
mongoc_uri_option_is_utf8
Returns true if the option is a known MongoDB URI option of string type. For example, "replicaSet=my_rs" is a valid MongoDB URI option, so...
mongoc_uri_set_auth_source
Sets the "authSource" URI option, after the URI has been parsed from a string. Updates the option in‐place if already set, otherwise appends it to the URI's...
mongoc_uri_set_database
Sets the URI's database, after the URI has been parsed from a string. The driver authenticates to this database if the connection string includes authentication...
mongoc_uri_set_option_as_bool
Sets an individual URI option, after the URI has been parsed from a string. Only known options of type bool can be set. Updates the option in‐place if already...
mongoc_uri_set_option_as_int32
Sets an individual URI option, after the URI has been parsed from a string. Only known options of type int32 can be set. Updates the option in‐place if already...
mongoc_uri_set_option_as_utf8
Sets an individual URI option, after the URI has been parsed from a string. Only known string‐type options can be set. Updates the option in‐place if already...
mongoc_uri_set_password
Sets the URI's password, after the URI has been parsed from a string. The driver authenticates with this password if the username is also set.
mongoc_uri_set_read_concern
Sets a MongoDB URI's read concern option, after the URI has been parsed from a string.
mongoc_uri_set_read_prefs_t
Sets a MongoDB URI's read preferences, after the URI has been parsed from a string.
mongoc_uri_set_username
Sets the URI's username, after the URI has been parsed from a string. The driver authenticates with this username if the password is also set.
mongoc_uri_set_write_concern
Sets a MongoDB URI's write concern option, after the URI has been parsed from a string.
mongoc_uri_t
mongoc_uri_t provides an abstraction on top of the MongoDB connection URI format. It provides standardized parsing as well as convenience methods for extracting...
mongoc_uri_unescape
Unescapes an URI encoded string. For example, "%40" would become "@".
mongoc_version
The following preprocessor macros can be used to perform various checks based on the version of the library you are compiling against. This may be useful if you...
mongoc_write_concern_append
This function appends a write concern to command options. It is useful for appending a write concern to command options before passing them to...
mongoc_write_concern_copy
Performs a deep copy of write_concern
mongoc_write_concern_destroy
Frees all resources associated with the write concern structure.
mongoc_write_concern_get_fsync
Fetches if an fsync should be performed before returning success on a write operation.
mongoc_write_concern_get_journal
Fetches if the write should be journaled before indicating success.
mongoc_write_concern_get_w
Fetches the w parameter of the write concern.
mongoc_write_concern_get_wmajority
Fetches if the write should be written to a majority of nodes before indicating success.
mongoc_write_concern_get_wtag
A string containing the wtag setting if it has been set. Otherwise returns NULL
mongoc_write_concern_get_wtimeout
Get the timeout in milliseconds that the server should wait before returning with a write concern timeout. A value of 0 indicates no write timeout.
mongoc_write_concern_is_acknowledged
Test if this is an acknowledged or unacknowledged write concern. If write_concern is NULL, returns true. (In other words, writes are acknowledged by default.)
mongoc_write_concern_is_valid
Test if this write concern uses an invalid combination of options.
mongoc_write_concern_journal_is_set
Test whether this write concern's "journal" option was explicitly set or uses the default setting.
mongoc_write_concern_new
None
mongoc_write_concern_set_fsync
Sets if a fsync must be performed before indicating write success.
mongoc_write_concern_set_journal
Sets if the write must have been journaled before indicating success.
mongoc_write_concern_set_w
Sets the w value for the write concern. See mongoc_write_concern_t for more information on this setting.
mongoc_write_concern_set_wmajority
Sets if the write must have been propagated to a majority of nodes before indicating write success. The timeout specifies how long, in milliseconds, the server...
mongoc_write_concern_set_wtag
Sets the write tag that must be satistified for the write to indicate success. Write tags are preset write concerns configured on your MongoDB server. See...
mongoc_write_concern_set_wtimeout
Set the timeout in milliseconds that the server should wait before returning with a write concern timeout. This is not the same as a socket timeout. A value of...
mongoc_write_concern_t
mongoc_write_concern_t tells the driver what level of acknowledgment to await from the server. The default, MONGOC_WRITE_CONCERN_W_DEFAULT, is right for the...