SYNOPSIS
#include <mongoc.h> mongoc_client_t * client; mongoc_collection_t * collection; client = mongoc_client_new(uri_string); collection = mongoc_client_get_collection (client, "db_name", "collection_name");
DESCRIPTION
mongoc_collection provides access to a MongoDB collection. This handle is useful for actions for most CRUD operations, I.e. insert, update, delete, find, etc.
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_collection_destroy(3) on a collection that has operations pending. It is required that you release mongoc_cursor(7) structures before calling mongoc_collection_destroy(3).
SEE ALSO
FUNCTIONS
mongoc_collection_aggregate(3) mongoc_collection_aggregate_legacy(3) mongoc_collection_destroy(3) mongoc_collection_command(3) mongoc_collection_command_simple(3) mongoc_collection_count(3) mongoc_collection_drop(3) mongoc_collection_drop_index(3) mongoc_collection_ensure_index(3) mongoc_collection_find(3) mongoc_collection_insert(3) mongoc_collection_insert_bulk(3) mongoc_collection_update(3) mongoc_collection_delete(3) mongoc_collection_save(3) mongoc_collection_get_read_prefs(3) mongoc_collection_set_read_prefs(3) mongoc_collection_get_write_concern(3) mongoc_collection_set_write_concern(3)
RELATED
AUTHORS
This page was written by MongoDB Inc.