20#include <bsoncxx/document/view_or_value.hpp>
21#include <bsoncxx/string/view_or_value.hpp>
22#include <mongocxx/collection.hpp>
23#include <mongocxx/options/modify_collection.hpp>
24#include <mongocxx/options/create_collection.hpp>
25#include <mongocxx/write_concern.hpp>
26#include <mongocxx/read_preference.hpp>
28#include <mongocxx/config/prelude.hpp>
31MONGOCXX_INLINE_NAMESPACE_BEGIN
81 explicit operator
bool() const noexcept;
93 bsoncxx::document::value run_command(bsoncxx::document::view_or_value command);
106 bsoncxx::
string::view_or_value name,
107 const options::create_collection& options = options::create_collection());
119 bsoncxx::document::value modify_collection(
120 stdx::string_view name,
121 const options::modify_collection& options = options::modify_collection());
142 bool has_collection(bsoncxx::
string::view_or_value name) const;
157 cursor list_collections(bsoncxx::document::view_or_value filter = {});
164 stdx::string_view
name()
const;
245 MONGOCXX_INLINE class
collection operator[](bsoncxx::string::view_or_value name) const;
251 MONGOCXX_PRIVATE
database(const class client& client, bsoncxx::string::view_or_value name);
253 class MONGOCXX_PRIVATE impl;
255 MONGOCXX_PRIVATE impl& _get_impl();
256 MONGOCXX_PRIVATE const impl& _get_impl() const;
258 std::unique_ptr<impl> _impl;
261MONGOCXX_INLINE
collection database::operator[](bsoncxx::string::view_or_value name) const {
265MONGOCXX_INLINE_NAMESPACE_END
268#include <mongocxx/config/postlude.hpp>
Class representing a client connection to MongoDB.
Definition client.hpp:49
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:74
Class representing a pointer to the result set of a query on a MongoDB server.
Definition cursor.hpp:35
Class representing a MongoDB database.
Definition database.hpp:43
database() noexcept
Default constructs a new database.
stdx::string_view name() const
Get the name of this database.
void write_concern(class write_concern wc)
Sets the write_concern for this database.
void read_concern(class read_concern rc)
Sets the read_concern for this database.
void read_preference(class read_preference rp)
Sets the read_preference for this database.
A class to represent the read concern.
Definition read_concern.hpp:46
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition read_preference.hpp:54
Class representing the server-side requirement for reporting the success of a write operation.
Definition write_concern.hpp:54