MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
mongocxx Namespace Reference

Description

The top-level namespace within which all mongocxx library entities are declared.

A MongoDB connection string.

In addition to declaring ABI namespaces (v_noabi, v1, etc.), this namespace also provides "redeclarations" of entities within ABI namespaces. These redeclarations are intended to be the preferred method for using mongocxx library entities when ABI stability of the mongocxx library is NOT a requirement by the user. See Root Namespace Redeclarations.

See also
Attention
This feature is experimental! It is not ready for use! // Copyright 2009-present MongoDB, Inc.

Namespaces

namespace  events
 Declares entities describing APM events.
namespace  gridfs
 Declares entities related to GridFS.
namespace  model
 Declares entities representing bulk write operations.
namespace  options
 Declares entities representing options to use with various commands.
namespace  result
 Declares entities representing the result of various commands.
namespace  v1
 Declares entities whose ABI stability is guaranteed for documented symbols.
namespace  v_noabi
 Declares entities whose ABI stability is NOT guaranteed.

Classes

class  authentication_exception
 Unused. To be removed in an upcoming major release. More...
class  bulk_write
 A batch of write operations that can be sent to the server as a group. More...
class  bulk_write_exception
 An exception thrown during a bulk write operation. More...
class  change_stream
 A MongoDB change stream. More...
class  client
 A client connection to a MongoDB server. More...
class  client_encryption
 Supports MongoDB Client-Side Field Level Encryption operations. More...
class  client_session
 Supports MongoDB client session operations. More...
class  collection
 A MongoDB collection. More...
class  cursor
 A cursor over the documents returned by a query to a MongoDB server. More...
class  database
 A MongoDB database. More...
class  default_logger
 A tag type representing mongoc's default unstructured log handler. More...
class  exception
 Base class for all exceptions thrown by the mongocxx library unless otherwise specified. More...
class  gridfs_exception
 An exception thrown during a GridFS operation. More...
class  hint
 The index to "hint" or force a MongoDB server to use when performing a query. More...
class  index_model
 Used by mongocxx::v_noabi::index_view. More...
class  index_view
 A MongoDB index. More...
class  instance
 An instance of the MongoDB C++ Driver. More...
class  logger
 The interface for an unstructured log message handler. More...
class  logic_error
 An exception thrown due to incorrect use of mongocxx interfaces. More...
class  operation_exception
 An exception thrown during a MongoDB server operation. More...
class  pipeline
 A MongoDB aggregation pipeline. More...
class  pool
 A pool of reusable client objects connected to the same MongoDB topology. More...
class  query_exception
 An exception thrown during a query operation. More...
class  read_concern
 Controls the consistency and isolation properties of data read from replica sets and sharded clusters. More...
class  read_preference
 Describes how MongoDB clients route read operations to the members of a replica set or sharded cluster. More...
class  search_index_model
 Used by mongocxx::v_noabi::search_index_view. More...
class  search_index_view
 A MongoDB Atlas Search Index. More...
class  text_options
 Options related to text queries for Queryable Encryption. More...
class  uri
 A MongoDB connection string URI. More...
class  validation_criteria
 Supports creating validation rules for fields. More...
class  write_concern
 The level of acknowledgment requested for write operations to a MongoDB server. More...
class  write_exception
 An exception thrown during a write operation. More...

Enumerations

enum class  error_code
 Errors which may occur during mongocxx library usage. More...
enum class  log_level
 The log level for an unstructured log message. More...
enum class  server_error_code
 Errors which may be returned by the server. More...
enum class  write_type
 Used by mongocxx::v_noabi::model::write. More...

Functions

std::error_category const & error_category ()
 Get the error_category for mongocxx library exceptions.
std::error_code make_error_code (error_code error)
 Translate a mongocxx::v_noabi::error_code into a std::error_code.
std::error_code make_error_code (error_code error)
 Translate a mongocxx::v_noabi::error_code into a std::error_code.
bool operator== (std::string str, hint const &hint)
 Convenience methods to compare against an index name.
bool operator== (std::string str, hint const &hint)
 Convenience methods to compare against an index name.
std::error_category const & server_error_category ()
 Get the error_category for mongocxx library exceptions.

Enumeration Type Documentation

◆ error_code

enum class mongocxx::v_noabi::error_code : std::int32_t
strong

Errors which may occur during mongocxx library usage.

Note
std::is_error_code_enum is specialized for this type.

◆ log_level

enum class mongocxx::v1::log_level
strong

The log level for an unstructured log message.

Attention
This feature is experimental! It is not ready for use!

◆ server_error_code

enum class mongocxx::v_noabi::server_error_code : std::int32_t
strong

Errors which may be returned by the server.

This type is used to represent Int32 server error codeswithout defining the error codes themselves.

Note
std::is_error_code_enum is specialized for this type.

◆ write_type

Function Documentation

◆ error_category()

std::error_category const & mongocxx::v_noabi::error_category ( )

Get the error_category for mongocxx library exceptions.

Returns
The mongocxx error_category

◆ make_error_code() [1/2]

std::error_code mongocxx::v_noabi::make_error_code ( error_code error)
inline

Translate a mongocxx::v_noabi::error_code into a std::error_code.

Parameters
errorA mongocxx::v_noabi::error_code
Returns
A std::error_code

◆ make_error_code() [2/2]

std::error_code mongocxx::v_noabi::make_error_code ( error_code error)
inline

Translate a mongocxx::v_noabi::error_code into a std::error_code.

Parameters
errorA mongocxx::v_noabi::error_code
Returns
A std::error_code

◆ operator==() [1/2]

bool operator== ( std::string str,
hint const & hint )
inline

Convenience methods to compare against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

◆ operator==() [2/2]

bool operator== ( std::string str,
hint const & hint )
inline

Convenience methods to compare against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

◆ server_error_category()

std::error_category const & mongocxx::v_noabi::server_error_category ( )

Get the error_category for mongocxx library exceptions.

Returns
The mongocxx error_category