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 inline namespace v_noabi {
34 class client_encryption;
82 explicit operator
bool() const noexcept;
108 const options::aggregate& options = options::aggregate());
135 const options::aggregate& options = options::aggregate());
166 bsoncxx::document::view_or_value command);
207 class
collection create_collection(stdx::string_view name,
208 bsoncxx::document::view_or_value collection_options = {},
234 stdx::string_view name,
235 bsoncxx::document::view_or_value collection_options = {},
236 const stdx::optional<write_concern>& write_concern = {});
259 MONGOCXX_DEPRECATED
class collection create_collection(
260 bsoncxx::string::view_or_value name,
261 const options::create_collection_deprecated& collection_options,
262 const stdx::optional<write_concern>& write_concern = {}) {
263 return create_collection_deprecated(name, collection_options, write_concern);
266 class collection create_collection_deprecated(
267 bsoncxx::string::view_or_value name,
268 const options::create_collection_deprecated& collection_options,
269 const stdx::optional<write_concern>& write_concern = {});
294 MONGOCXX_DEPRECATED
class collection create_collection(
295 const client_session& session,
296 bsoncxx::string::view_or_value name,
297 const options::create_collection_deprecated& collection_options,
298 const stdx::optional<write_concern>& write_concern = {}) {
299 return create_collection_deprecated(session, name, collection_options, write_concern);
325 class collection create_collection_deprecated(
326 const client_session& session,
327 bsoncxx::string::view_or_value name,
328 const options::create_collection_deprecated& collection_options,
329 const stdx::optional<write_concern>& write_concern = {});
368 const bsoncxx::stdx::optional<mongocxx::write_concern>&
write_concern = {});
412 bsoncxx::document::view_or_value filter = {});
445 bsoncxx::document::view_or_value filter = {});
456 stdx::string_view
name()
const;
537 MONGOCXX_INLINE class
collection operator[](bsoncxx::string::view_or_value name) const;
554 const options::gridfs::bucket& options = options::gridfs::bucket()) const;
583 change_stream watch(const client_session& session, const options::change_stream& options = {});
601 change_stream watch(const pipeline& pipe, const options::change_stream& options = {});
619 const pipeline& pipe,
620 const options::change_stream& options = {});
631 MONGOCXX_PRIVATE
database(const class client& client, bsoncxx::string::view_or_value name);
633 MONGOCXX_PRIVATE
cursor _aggregate(const client_session* session,
634 const pipeline& pipeline,
635 const options::aggregate& options);
637 MONGOCXX_PRIVATE bsoncxx::document::value _run_command(
638 const client_session* session, bsoncxx::document::view_or_value command);
640 MONGOCXX_PRIVATE class
collection _create_collection(
641 const client_session* session,
642 stdx::string_view name,
643 bsoncxx::document::view_or_value collection_options,
644 const stdx::optional<class write_concern>& write_concern);
646 MONGOCXX_PRIVATE class
collection _create_collection_deprecated(
647 const client_session* session,
648 bsoncxx::string::view_or_value name,
649 const options::create_collection_deprecated& collection_options,
650 const stdx::optional<class write_concern>& write_concern);
652 MONGOCXX_PRIVATE
cursor _list_collections(const client_session* session,
653 bsoncxx::document::view_or_value filter);
655 MONGOCXX_PRIVATE std::vector<std::string> _list_collection_names(
656 const client_session* session, bsoncxx::document::view_or_value filter);
658 MONGOCXX_PRIVATE void _drop(
659 const client_session* session,
660 const bsoncxx::stdx::optional<mongocxx::write_concern>& write_concern);
662 MONGOCXX_PRIVATE
change_stream _watch(const client_session* session,
663 const pipeline& pipe,
664 const options::change_stream& options);
666 class MONGOCXX_PRIVATE impl;
668 MONGOCXX_PRIVATE impl& _get_impl();
669 MONGOCXX_PRIVATE const impl& _get_impl() const;
671 std::unique_ptr<impl> _impl;
674 MONGOCXX_INLINE
collection database::operator[](bsoncxx::string::view_or_value name) const {
681 #include <mongocxx/config/postlude.hpp>
Class representing a MongoDB change stream.
Definition: change_stream.hpp:33
Class supporting operations for MongoDB Client-Side Field Level Encryption.
Definition: client_encryption.hpp:38
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition: client_session.hpp:40
Class representing a client connection to MongoDB.
Definition: client.hpp:54
Class representing server side document groupings within a MongoDB database.
Definition: collection.hpp:85
Class representing a pointer to the result set of a query on a MongoDB server.
Definition: cursor.hpp:36
Class representing a MongoDB database.
Definition: database.hpp:44
stdx::string_view name() const
Get the name of this database.
std::vector< std::string > list_collection_names(bsoncxx::document::view_or_value filter={})
Enumerates the collection names in this database.
void drop(const client_session &session, const bsoncxx::stdx::optional< mongocxx::write_concern > &write_concern={})
Drops the database and all its collections.
cursor list_collections(const client_session &session, bsoncxx::document::view_or_value filter={})
Enumerates the collections in this database.
std::vector< std::string > list_collection_names(const client_session &session, bsoncxx::document::view_or_value filter={})
Enumerates the collection names in this database.
database() noexcept
Default constructs a new database.
void drop(const bsoncxx::stdx::optional< mongocxx::write_concern > &write_concern={})
Drops the database and all its collections.
cursor list_collections(bsoncxx::document::view_or_value filter={})
Enumerates the collections in this database.
bool has_collection(bsoncxx::string::view_or_value name) const
Checks whether this database contains a collection having the given name.
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.
Class representing a GridFS bucket.
Definition: bucket.hpp:62
Class representing a MongoDB aggregation pipeline.
Definition: pipeline.hpp:37
A class to represent the read concern.
Definition: read_concern.hpp:57
Class representing a preference for how the driver routes read operations to members of a replica set...
Definition: read_preference.hpp:67
Class representing the server-side requirement for reporting the success of a write operation.
Definition: write_concern.hpp:59
The top-level namespace for bsoncxx library entities.
Definition: element.hpp:24
The top-level namespace for mongocxx library entities.
Definition: bulk_write.hpp:24