20 #include <bsoncxx/document/view_or_value.hpp> 21 #include <bsoncxx/string/view_or_value.hpp> 22 #include <mongocxx/client_session.hpp> 23 #include <mongocxx/collection.hpp> 24 #include <mongocxx/gridfs/bucket.hpp> 25 #include <mongocxx/options/create_collection.hpp> 26 #include <mongocxx/options/gridfs/bucket.hpp> 27 #include <mongocxx/read_preference.hpp> 28 #include <mongocxx/write_concern.hpp> 30 #include <mongocxx/config/prelude.hpp> 33 MONGOCXX_INLINE_NAMESPACE_BEGIN
81 explicit operator bool()
const noexcept;
133 const pipeline& pipeline,
203 class collection create_collection(stdx::string_view name,
226 class collection create_collection(const client_session& session,
227 stdx::string_view name,
229 const stdx::optional<write_concern>& write_concern = {});
253 bsoncxx::string::view_or_value name,
255 const stdx::optional<write_concern>& write_concern = {}) {
256 return create_collection_deprecated(name, collection_options, write_concern);
259 class collection create_collection_deprecated(
260 bsoncxx::string::view_or_value name,
262 const stdx::optional<write_concern>& write_concern = {});
288 const client_session& session,
291 const stdx::optional<write_concern>& write_concern = {}) {
292 return create_collection_deprecated(session, name, collection_options, write_concern);
295 class collection create_collection_deprecated(
296 const client_session& session,
299 const stdx::optional<write_concern>& write_concern = {});
320 void drop(
const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern = {});
337 void drop(
const client_session& session,
338 const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern = {});
381 cursor list_collections(
const client_session& session,
414 std::vector<std::string> list_collection_names(
const client_session& session,
426 stdx::string_view name()
const;
450 class read_concern read_concern() const;
472 class read_preference read_preference() const;
481 void write_concern(
class write_concern wc);
488 class write_concern write_concern() const;
497 class collection collection(bsoncxx::string::view_or_value name) const;
507 MONGOCXX_INLINE class collection operator[](bsoncxx::string::view_or_value name) const;
524 const options::gridfs::bucket& options = options::gridfs::bucket()) const;
540 change_stream watch(const options::change_stream& options = {});
553 change_stream watch(const client_session& session, const options::change_stream& options = {});
571 change_stream watch(const pipeline& pipe, const options::change_stream& options = {});
589 const pipeline& pipe,
590 const options::change_stream& options = {});
598 friend class collection;
600 MONGOCXX_PRIVATE
database(const class client& client, bsoncxx::string::view_or_value name);
602 MONGOCXX_PRIVATE
cursor _aggregate(const client_session* session,
603 const pipeline& pipeline,
604 const options::aggregate& options);
607 const client_session* session, bsoncxx::document::view_or_value command);
609 MONGOCXX_PRIVATE class collection _create_collection(
610 const client_session* session,
611 stdx::string_view name,
612 bsoncxx::document::view_or_value collection_options,
613 const stdx::optional<class write_concern>& write_concern);
615 MONGOCXX_PRIVATE class collection _create_collection_deprecated(
616 const client_session* session,
617 bsoncxx::string::view_or_value name,
618 const options::create_collection_deprecated& collection_options,
619 const stdx::optional<class write_concern>& write_concern);
621 MONGOCXX_PRIVATE
cursor _list_collections(const client_session* session,
622 bsoncxx::document::view_or_value filter);
624 MONGOCXX_PRIVATE std::vector<std::string> _list_collection_names(
625 const client_session* session, bsoncxx::document::view_or_value filter);
627 MONGOCXX_PRIVATE void _drop(
628 const client_session* session,
629 const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern);
631 MONGOCXX_PRIVATE
change_stream _watch(const client_session* session,
632 const pipeline& pipe,
633 const options::change_stream& options);
635 class MONGOCXX_PRIVATE impl;
637 MONGOCXX_PRIVATE impl& _get_impl();
638 MONGOCXX_PRIVATE const impl& _get_impl() const;
640 std::unique_ptr<impl> _impl;
643 MONGOCXX_INLINE collection database::operator[](bsoncxx::string::view_or_value name) const {
644 return collection(name);
647 MONGOCXX_INLINE_NAMESPACE_END
650 #include <mongocxx/config/postlude.hpp> Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
A read-only BSON document that owns its underlying buffer.
Definition: value.hpp:33
Class representing a pointer to the result set of a query on a MongoDB server.
Definition: cursor.hpp:36
Class representing a client connection to MongoDB.
Definition: client.hpp:57
Use a session for a sequence of operations, optionally with causal consistency.
Definition: client_session.hpp:39
Class representing a GridFS bucket.
Definition: bucket.hpp:62
Class representing a MongoDB database.
Definition: database.hpp:43
Definition: change_stream.hpp:31
Class representing a MongoDB aggregation pipeline.
Definition: pipeline.hpp:38
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition: read_preference.hpp:62
Class representing the optional arguments to a MongoDB aggregation operation.
Definition: aggregate.hpp:38
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:36
Class representing the optional arguments to a MongoDB createCollection command.
Definition: create_collection.hpp:35
A class to represent the read concern.
Definition: read_concern.hpp:54
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24
Class representing the server-side requirement for reporting the success of a write operation...
Definition: write_concern.hpp:56
Class representing server side document groupings within a MongoDB database.
Definition: collection.hpp:85