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;
206 class collection create_collection(stdx::string_view name,
233 stdx::string_view name,
259 bsoncxx::string::view_or_value name,
262 return create_collection_deprecated(name, collection_options,
write_concern);
265 class collection create_collection_deprecated(
266 bsoncxx::string::view_or_value name,
267 const options::create_collection_deprecated& collection_options,
268 const stdx::optional<write_concern>& write_concern = {});
298 return create_collection_deprecated(session, name, collection_options,
write_concern);
324 class collection create_collection_deprecated(
325 const client_session& session,
327 const options::create_collection_deprecated& collection_options,
328 const stdx::optional<write_concern>& write_concern = {});
349 void drop(
const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern = {});
366 void drop(
const client_session& session,
367 const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern = {});
410 cursor list_collections(
const client_session& session,
443 std::vector<std::string> list_collection_names(
const client_session& session,
455 stdx::string_view name()
const;
469 void read_concern(
class read_concern rc);
479 class read_concern read_concern() const;
492 void read_preference(
class read_preference rp);
501 class read_preference read_preference() const;
510 void write_concern(
class write_concern wc);
517 class write_concern write_concern() const;
526 class collection collection(
bsoncxx::string::view_or_value name) const;
536 MONGOCXX_INLINE class collection operator[](bsoncxx::string::view_or_value name) const;
552 class gridfs::bucket gridfs_bucket(
553 const options::gridfs::bucket& options = options::gridfs::bucket()) const;
569 change_stream watch(const options::change_stream& options = {});
582 change_stream watch(const client_session& session, const options::change_stream& options = {});
600 change_stream watch(const pipeline& pipe, const options::change_stream& options = {});
617 change_stream watch(const client_session& session,
618 const pipeline& pipe,
619 const options::change_stream& options = {});
627 friend class collection;
629 MONGOCXX_PRIVATE database(const class client& client, bsoncxx::string::view_or_value name);
631 MONGOCXX_PRIVATE cursor _aggregate(const client_session* session,
632 const pipeline& pipeline,
633 const options::aggregate& options);
636 const client_session* session, bsoncxx::document::view_or_value command);
638 MONGOCXX_PRIVATE class collection _create_collection(
639 const client_session* session,
640 stdx::string_view name,
641 bsoncxx::document::view_or_value collection_options,
642 const stdx::optional<class write_concern>& write_concern);
644 MONGOCXX_PRIVATE class collection _create_collection_deprecated(
645 const client_session* session,
646 bsoncxx::string::view_or_value name,
647 const options::create_collection_deprecated& collection_options,
648 const stdx::optional<class write_concern>& write_concern);
650 MONGOCXX_PRIVATE cursor _list_collections(const client_session* session,
651 bsoncxx::document::view_or_value filter);
653 MONGOCXX_PRIVATE std::vector<std::string> _list_collection_names(
654 const client_session* session, bsoncxx::document::view_or_value filter);
656 MONGOCXX_PRIVATE void _drop(
657 const client_session* session,
658 const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern);
660 MONGOCXX_PRIVATE change_stream _watch(const client_session* session,
661 const pipeline& pipe,
662 const options::change_stream& options);
664 class MONGOCXX_PRIVATE impl;
666 MONGOCXX_PRIVATE impl& _get_impl();
667 MONGOCXX_PRIVATE const impl& _get_impl() const;
669 std::unique_ptr<impl> _impl;
672 MONGOCXX_INLINE
collection database::operator[](bsoncxx::string::view_or_value name) const {
676 MONGOCXX_INLINE_NAMESPACE_END
679 #include <mongocxx/config/postlude.hpp>