20 #include <mongocxx/client-fwd.hpp>
21 #include <mongocxx/client_encryption-fwd.hpp>
22 #include <mongocxx/collection-fwd.hpp>
23 #include <mongocxx/database-fwd.hpp>
25 #include <bsoncxx/document/view_or_value.hpp>
26 #include <bsoncxx/string/view_or_value.hpp>
27 #include <mongocxx/client_session.hpp>
28 #include <mongocxx/collection.hpp>
29 #include <mongocxx/gridfs/bucket.hpp>
30 #include <mongocxx/options/create_collection.hpp>
31 #include <mongocxx/options/gridfs/bucket.hpp>
32 #include <mongocxx/read_preference.hpp>
33 #include <mongocxx/write_concern.hpp>
35 #include <mongocxx/config/prelude.hpp>
84 explicit operator
bool() const noexcept;
155 bsoncxx::v_noabi::document::view_or_value command);
211 stdx::string_view
name,
212 bsoncxx::v_noabi::document::view_or_value collection_options = {},
239 stdx::string_view
name,
355 void drop(
const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern>&
374 const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern>&
464 stdx::string_view
name()
const;
636 friend ::mongocxx::v_noabi::client_encryption;
637 friend ::mongocxx::v_noabi::client;
638 friend ::mongocxx::v_noabi::collection;
652 stdx::string_view
name,
654 const stdx::optional<mongocxx::v_noabi::write_concern>&
write_concern);
660 const stdx::optional<mongocxx::v_noabi::write_concern>&
write_concern);
665 MONGOCXX_PRIVATE std::vector<std::string> _list_collection_names(
668 MONGOCXX_PRIVATE
void _drop(
670 const bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern>&
write_concern);
676 class MONGOCXX_PRIVATE impl;
678 MONGOCXX_PRIVATE impl& _get_impl();
679 MONGOCXX_PRIVATE
const impl& _get_impl()
const;
681 std::unique_ptr<impl> _impl;
692 #include <mongocxx/config/postlude.hpp>
A read-only BSON document that owns its underlying buffer.
Definition: value.hpp:38
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:38
Class representing a MongoDB change stream.
Definition: change_stream.hpp:35
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition: client_session.hpp:47
Class representing a client connection to MongoDB.
Definition: client.hpp:61
Class representing server side document groupings within a MongoDB database.
Definition: collection.hpp:86
Class representing a pointer to the result set of a query on a MongoDB server.
Definition: cursor.hpp:42
Class representing a MongoDB database.
Definition: database.hpp:46
void read_concern(mongocxx::v_noabi::read_concern rc)
Sets the read_concern for this database.
bsoncxx::v_noabi::document::value run_command(bsoncxx::v_noabi::document::view_or_value command)
Runs a command against this database.
mongocxx::v_noabi::collection operator[](bsoncxx::v_noabi::string::view_or_value name) const
Allows the db["collection_name"] syntax to be used to access a collection within this database.
Definition: database.hpp:684
stdx::string_view name() const
Get the name of this database.
void write_concern(mongocxx::v_noabi::write_concern wc)
Sets the write_concern for this database.
cursor list_collections(const client_session &session, bsoncxx::v_noabi::document::view_or_value filter={})
Enumerates the collections in this database.
change_stream watch(const pipeline &pipe, const options::change_stream &options={})
Gets a change stream on this database.
cursor aggregate(const pipeline &pipeline, const options::aggregate &options=options::aggregate())
Runs an aggregation framework pipeline against this database for pipeline stages that do not require ...
mongocxx::v_noabi::collection create_collection(const client_session &session, stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options={}, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
change_stream watch(const options::change_stream &options={})
Gets a change stream on this database with an empty pipeline.
std::vector< std::string > list_collection_names(bsoncxx::v_noabi::document::view_or_value filter={})
Enumerates the collection names in this database.
mongocxx::v_noabi::collection create_collection(stdx::string_view name, bsoncxx::v_noabi::document::view_or_value collection_options={}, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
void drop(const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > &write_concern={})
Drops the database and all its collections.
database() noexcept
Default constructs a new database.
std::vector< std::string > list_collection_names(const client_session &session, bsoncxx::v_noabi::document::view_or_value filter={})
Enumerates the collection names in this database.
cursor list_collections(bsoncxx::v_noabi::document::view_or_value filter={})
Enumerates the collections in this database.
mongocxx::v_noabi::read_preference read_preference() const
The current read preference for this database.
mongocxx::v_noabi::read_concern read_concern() const
The current read concern for this database.
void read_preference(mongocxx::v_noabi::read_preference rp)
Sets the read_preference for this database.
mongocxx::v_noabi::collection collection(bsoncxx::v_noabi::string::view_or_value name) const
Access a collection (logical grouping of documents) within this database.
change_stream watch(const client_session &session, const options::change_stream &options={})
void drop(const client_session &session, const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > &write_concern={})
Drops the database and all its collections.
mongocxx::v_noabi::collection create_collection(const client_session &session, bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated &collection_options, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
Definition: database.hpp:299
mongocxx::v_noabi::collection create_collection_deprecated(bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated &collection_options, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
bool has_collection(bsoncxx::v_noabi::string::view_or_value name) const
Checks whether this database contains a collection having the given name.
mongocxx::v_noabi::write_concern write_concern() const
The current write_concern for this database.
change_stream watch(const client_session &session, const pipeline &pipe, const options::change_stream &options={})
Gets a change stream on this database.
mongocxx::v_noabi::collection create_collection(bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated &collection_options, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
Definition: database.hpp:264
mongocxx::v_noabi::collection create_collection_deprecated(const client_session &session, bsoncxx::v_noabi::string::view_or_value name, const options::create_collection_deprecated &collection_options, const stdx::optional< write_concern > &write_concern={})
Explicitly creates a collection in this database with the specified options.
gridfs::bucket gridfs_bucket(const options::gridfs::bucket &options=options::gridfs::bucket()) const
Access a GridFS bucket within this database.
Class representing a GridFS bucket.
Definition: bucket.hpp:63
Class representing the optional arguments to a MongoDB aggregation operation.
Definition: aggregate.hpp:43
Class representing MongoDB change stream options.
Definition: change_stream.hpp:39
Class representing the optional arguments to a MongoDB createCollection command.
Definition: create_collection.hpp:35
Class representing the optional arguments to a MongoDB GridFS bucket creation operation.
Definition: bucket.hpp:37
Class representing a MongoDB aggregation pipeline.
Definition: pipeline.hpp:39
A class to represent the read concern.
Definition: read_concern.hpp:56
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition: read_preference.hpp:63
Class representing the server-side requirement for reporting the success of a write operation.
Definition: write_concern.hpp:58
The top-level namespace for bsoncxx library entities.
Definition: element-fwd.hpp:19
The top-level namespace for mongocxx library entities.
Definition: bulk_write-fwd.hpp:19