SYNOPSIS

#include <mongoc.h>

{
   mongoc_database_t *database;
   mongoc_client_t *client;

   client = mongoc_client_new (uri_string);
   database = mongoc_client_get_database (client, "db_name");
}

DESCRIPTION

mongoc_database provides access to a MongoDB database. This handle is useful for actions against a particular database object. It isn’t a container for mongoc_collection(7) structures.

READ PREFERENCES & WRITE CONCERNS

Read preferences and write concerns are inherited from the parent client. They can be overridden by set_* commands if so desired.

LIFECYCLE

It is an error to call mongoc_database_destroy(3) on a database that has operations pending. It is required that you release mongoc_cursor(7) structures before calling mongoc_database_destroy(3).

SEE ALSO

AUTHORS

This page was written by MongoDB Inc.