20#include <bsoncxx/builder/basic/array.hpp>
21#include <bsoncxx/builder/basic/document.hpp>
22#include <bsoncxx/builder/basic/kvp.hpp>
23#include <bsoncxx/builder/concatenate.hpp>
24#include <bsoncxx/document/view_or_value.hpp>
25#include <bsoncxx/oid.hpp>
26#include <bsoncxx/stdx/optional.hpp>
27#include <bsoncxx/string/view_or_value.hpp>
28#include <mongocxx/bulk_write.hpp>
29#include <mongocxx/change_stream.hpp>
30#include <mongocxx/client_session.hpp>
31#include <mongocxx/cursor.hpp>
32#include <mongocxx/index_view.hpp>
33#include <mongocxx/model/insert_one.hpp>
34#include <mongocxx/options/aggregate.hpp>
35#include <mongocxx/options/bulk_write.hpp>
36#include <mongocxx/options/change_stream.hpp>
37#include <mongocxx/options/count.hpp>
38#include <mongocxx/options/delete.hpp>
39#include <mongocxx/options/distinct.hpp>
40#include <mongocxx/options/estimated_document_count.hpp>
41#include <mongocxx/options/find.hpp>
42#include <mongocxx/options/find_one_and_delete.hpp>
43#include <mongocxx/options/find_one_and_replace.hpp>
44#include <mongocxx/options/find_one_and_update.hpp>
45#include <mongocxx/options/index.hpp>
46#include <mongocxx/options/index_view.hpp>
47#include <mongocxx/options/insert.hpp>
48#include <mongocxx/options/replace.hpp>
49#include <mongocxx/options/update.hpp>
50#include <mongocxx/pipeline.hpp>
51#include <mongocxx/read_concern.hpp>
52#include <mongocxx/read_preference.hpp>
53#include <mongocxx/result/bulk_write.hpp>
54#include <mongocxx/result/delete.hpp>
55#include <mongocxx/result/insert_many.hpp>
56#include <mongocxx/result/insert_one.hpp>
57#include <mongocxx/result/replace_one.hpp>
58#include <mongocxx/result/update.hpp>
59#include <mongocxx/search_index_view.hpp>
60#include <mongocxx/write_concern.hpp>
62#include <mongocxx/config/prelude.hpp>
65inline namespace v_noabi {
67class client_encryption;
98 class _empty_doc_tag {
99 _empty_doc_tag() =
default;
140 explicit operator
bool() const noexcept;
164 const options::aggregate& options = options::aggregate());
189 const options::aggregate& options = options::aggregate());
248 MONGOCXX_INLINE stdx::optional<result::bulk_write> write(
273 MONGOCXX_INLINE stdx::optional<result::bulk_write> write(
304 template <
typename container_type>
305 MONGOCXX_INLINE stdx::optional<result::bulk_write>
bulk_write(
331 template <
typename container_type>
332 MONGOCXX_INLINE stdx::optional<result::bulk_write>
bulk_write(
334 const container_type& writes,
364 template <
typename write_model_iterator_type>
365 MONGOCXX_INLINE stdx::optional<result::bulk_write>
bulk_write(
366 write_model_iterator_type begin,
367 write_model_iterator_type end,
394 template <
typename write_model_iterator_type>
395 MONGOCXX_INLINE stdx::optional<result::bulk_write>
bulk_write(
397 write_model_iterator_type begin,
398 write_model_iterator_type end,
453 bsoncxx::document::view_or_value filter,
504 bsoncxx::document::view_or_value keys,
505 bsoncxx::document::view_or_value index_options = {},
531 bsoncxx::document::view_or_value keys,
532 bsoncxx::document::view_or_value index_options = {},
558 bsoncxx::document::view_or_value filter,
581 bsoncxx::document::view_or_value filter,
607 bsoncxx::document::view_or_value filter,
630 bsoncxx::document::view_or_value filter,
656 bsoncxx::document::view_or_value filter,
678 bsoncxx::string::view_or_value name,
679 bsoncxx::document::view_or_value filter,
708 bsoncxx::document::view_or_value collection_options = {});
731 const bsoncxx::stdx::optional<mongocxx::write_concern>&
write_concern = {},
732 bsoncxx::document::view_or_value collection_options = {});
780 bsoncxx::document::view_or_value filter,
820 bsoncxx::document::view_or_value filter,
847 bsoncxx::document::view_or_value filter,
871 bsoncxx::document::view_or_value filter,
901 bsoncxx::document::view_or_value filter,
902 bsoncxx::document::view_or_value replacement,
929 bsoncxx::document::view_or_value filter,
930 bsoncxx::document::view_or_value replacement,
960 bsoncxx::document::view_or_value filter,
961 bsoncxx::document::view_or_value update,
985 bsoncxx::document::view_or_value filter,
1010 bsoncxx::document::view_or_value filter,
1011 std::initializer_list<_empty_doc_tag> update,
1038 bsoncxx::document::view_or_value filter,
1039 bsoncxx::document::view_or_value update,
1066 bsoncxx::document::view_or_value filter,
1094 bsoncxx::document::view_or_value filter,
1095 std::initializer_list<_empty_doc_tag> update,
1118 stdx::optional<result::insert_one>
insert_one(bsoncxx::document::view_or_value document,
1137 bsoncxx::document::view_or_value document,
1168 template <
typename container_type>
1169 MONGOCXX_INLINE stdx::optional<result::insert_many> insert_many(
1193 template <
typename container_type>
1194 MONGOCXX_INLINE stdx::optional<result::insert_many> insert_many(
1196 const container_type& container,
1224 template <
typename document_view_iterator_type>
1225 MONGOCXX_INLINE stdx::optional<result::insert_many> insert_many(
1226 document_view_iterator_type begin,
1227 document_view_iterator_type end,
1251 template <
typename document_view_iterator_type>
1252 MONGOCXX_INLINE stdx::optional<result::insert_many> insert_many(
1254 document_view_iterator_type begin,
1255 document_view_iterator_type end,
1319 void rename(bsoncxx::string::view_or_value new_name,
1320 bool drop_target_before_rename =
false,
1321 const bsoncxx::stdx::optional<write_concern>&
write_concern = {});
1345 bsoncxx::string::view_or_value new_name,
1346 bool drop_target_before_rename =
false,
1347 const bsoncxx::stdx::optional<write_concern>&
write_concern = {});
1417 bsoncxx::document::view_or_value filter,
1418 bsoncxx::document::view_or_value replacement,
1445 bsoncxx::document::view_or_value filter,
1446 bsoncxx::document::view_or_value replacement,
1471 stdx::optional<result::update>
update_many(bsoncxx::document::view_or_value filter,
1472 bsoncxx::document::view_or_value update,
1495 stdx::optional<result::update>
update_many(bsoncxx::document::view_or_value filter,
1519 stdx::optional<result::update>
update_many(bsoncxx::document::view_or_value filter,
1520 std::initializer_list<_empty_doc_tag> update,
1546 bsoncxx::document::view_or_value filter,
1547 bsoncxx::document::view_or_value update,
1573 bsoncxx::document::view_or_value filter,
1600 bsoncxx::document::view_or_value filter,
1601 std::initializer_list<_empty_doc_tag> update,
1630 stdx::optional<result::update>
update_one(bsoncxx::document::view_or_value filter,
1631 bsoncxx::document::view_or_value update,
1654 stdx::optional<result::update>
update_one(bsoncxx::document::view_or_value filter,
1678 stdx::optional<result::update>
update_one(bsoncxx::document::view_or_value filter,
1679 std::initializer_list<_empty_doc_tag> update,
1705 bsoncxx::document::view_or_value filter,
1706 bsoncxx::document::view_or_value update,
1732 bsoncxx::document::view_or_value filter,
1759 bsoncxx::document::view_or_value filter,
1760 std::initializer_list<_empty_doc_tag> update,
1867 bsoncxx::string::view_or_value collection_name);
1875 MONGOCXX_PRIVATE std::int64_t _count(
const client_session* session,
1876 bsoncxx::document::view_or_value filter,
1879 MONGOCXX_PRIVATE std::int64_t _count_documents(
const client_session* session,
1880 bsoncxx::document::view_or_value filter,
1883 MONGOCXX_PRIVATE bsoncxx::document::value _create_index(
1885 bsoncxx::document::view_or_value keys,
1886 bsoncxx::document::view_or_value index_options,
1889 MONGOCXX_PRIVATE stdx::optional<result::delete_result> _delete_many(
1891 bsoncxx::document::view_or_value filter,
1894 MONGOCXX_PRIVATE stdx::optional<result::delete_result> _delete_one(
1896 bsoncxx::document::view_or_value filter,
1900 bsoncxx::string::view_or_value name,
1901 bsoncxx::document::view_or_value filter,
1904 MONGOCXX_PRIVATE
void _drop(
1906 const bsoncxx::stdx::optional<mongocxx::write_concern>&
write_concern,
1907 bsoncxx::document::view_or_value collection_options);
1910 bsoncxx::document::view_or_value filter,
1913 MONGOCXX_PRIVATE stdx::optional<bsoncxx::document::value> _find_one(
1915 bsoncxx::document::view_or_value filter,
1918 MONGOCXX_PRIVATE stdx::optional<bsoncxx::document::value> _find_one_and_delete(
1920 bsoncxx::document::view_or_value filter,
1923 MONGOCXX_PRIVATE stdx::optional<bsoncxx::document::value> _find_one_and_replace(
1925 bsoncxx::document::view_or_value filter,
1926 bsoncxx::document::view_or_value replacement,
1929 MONGOCXX_PRIVATE stdx::optional<bsoncxx::document::value> _find_one_and_update(
1931 bsoncxx::document::view_or_value filter,
1932 bsoncxx::document::view_or_value update,
1935 MONGOCXX_PRIVATE stdx::optional<result::insert_one> _insert_one(
1937 bsoncxx::document::view_or_value document,
1940 MONGOCXX_PRIVATE
void _rename(
1942 bsoncxx::string::view_or_value new_name,
1943 bool drop_target_before_rename,
1944 const bsoncxx::stdx::optional<class write_concern>&
write_concern);
1946 MONGOCXX_PRIVATE stdx::optional<result::replace_one> _replace_one(
1951 MONGOCXX_PRIVATE stdx::optional<result::replace_one> _replace_one(
1953 bsoncxx::document::view_or_value filter,
1954 bsoncxx::document::view_or_value replacement,
1957 MONGOCXX_PRIVATE stdx::optional<result::update> _update_one(
1959 bsoncxx::document::view_or_value filter,
1960 bsoncxx::document::view_or_value update,
1963 MONGOCXX_PRIVATE stdx::optional<result::update> _update_many(
1965 bsoncxx::document::view_or_value filter,
1966 bsoncxx::document::view_or_value update,
1974 class bulk_write _init_insert_many(const options::insert& options,
1977 void _insert_many_doc_handler(class bulk_write& writes,
1978 bsoncxx::builder::basic::array& inserted_ids,
1979 bsoncxx::document::view doc) const;
1981 stdx::optional<result::insert_many> _exec_insert_many(
1982 class bulk_write& writes, bsoncxx::builder::basic::array& inserted_ids);
1984 template <typename document_view_iterator_type>
1985 MONGOCXX_PRIVATE stdx::optional<result::insert_many> _insert_many(
1986 const client_session* session,
1987 document_view_iterator_type begin,
1988 document_view_iterator_type end,
1989 const options::insert& options);
1991 class MONGOCXX_PRIVATE impl;
1993 MONGOCXX_PRIVATE impl& _get_impl();
1994 MONGOCXX_PRIVATE const impl& _get_impl() const;
1996 std::unique_ptr<impl> _impl;
1999MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::write(
2000 const model::write& write, const options::bulk_write& options) {
2001 return create_bulk_write(options).append(write).execute();
2004MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::write(
2006 return create_bulk_write(session, options).append(write).execute();
2009template <
typename container_type>
2010MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::bulk_write(
2012 return bulk_write(requests.begin(), requests.end(), options);
2015template <
typename container_type>
2016MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::bulk_write(
2018 const container_type& requests,
2020 return bulk_write(session, requests.begin(), requests.end(), options);
2023template <
typename write_model_iterator_type>
2024MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::bulk_write(
2025 write_model_iterator_type begin,
2026 write_model_iterator_type end,
2028 auto writes = create_bulk_write(options);
2029 std::for_each(begin, end, [&](
const model::write& current) { writes.append(current); });
2030 return writes.execute();
2033template <
typename write_model_iterator_type>
2034MONGOCXX_INLINE stdx::optional<result::bulk_write> collection::bulk_write(
2036 write_model_iterator_type begin,
2037 write_model_iterator_type end,
2039 auto writes = create_bulk_write(session, options);
2040 std::for_each(begin, end, [&](
const model::write& current) { writes.append(current); });
2041 return writes.execute();
2044template <
typename container_type>
2045MONGOCXX_INLINE stdx::optional<result::insert_many> collection::insert_many(
2047 return insert_many(container.begin(), container.end(), options);
2050template <
typename container_type>
2051MONGOCXX_INLINE stdx::optional<result::insert_many> collection::insert_many(
2053 const container_type& container,
2055 return insert_many(session, container.begin(), container.end(), options);
2058template <
typename document_view_iterator_type>
2059MONGOCXX_INLINE stdx::optional<result::insert_many> collection::_insert_many(
2062 document_view_iterator_type begin,
2063 document_view_iterator_type end,
2066 auto writes = _init_insert_many(options, session);
2067 std::for_each(begin, end, [&inserted_ids, &writes,
this](bsoncxx::document::view doc) {
2068 _insert_many_doc_handler(writes, inserted_ids, doc);
2070 return _exec_insert_many(writes, inserted_ids);
2073template <
typename document_view_iterator_type>
2074MONGOCXX_INLINE stdx::optional<result::insert_many> collection::insert_many(
2075 document_view_iterator_type begin,
2076 document_view_iterator_type end,
2078 return _insert_many(
nullptr, begin, end, options);
2081template <
typename document_view_iterator_type>
2082MONGOCXX_INLINE stdx::optional<result::insert_many> collection::insert_many(
2084 document_view_iterator_type begin,
2085 document_view_iterator_type end,
2087 return _insert_many(&session, begin, end, options);
2093#include <mongocxx/config/postlude.hpp>
A traditional builder-style interface for constructing a BSON array.
Definition array.hpp:35
Class representing a batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:42
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 server side document groupings within a MongoDB database.
Definition collection.hpp:85
stdx::optional< result::update > update_one(const client_session &session, bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
stdx::optional< bsoncxx::document::value > find_one_and_update(bsoncxx::document::view_or_value filter, const pipeline &update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
stdx::optional< result::update > update_many(const client_session &session, bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
bsoncxx::document::value create_index(const client_session &session, bsoncxx::document::view_or_value keys, bsoncxx::document::view_or_value index_options={}, options::index_view operation_options=options::index_view{})
Creates an index over the collection for the provided keys with the provided options.
change_stream watch(const pipeline &pipe, const options::change_stream &options={})
Gets a change stream on this collection.
stdx::optional< result::update > update_many(bsoncxx::document::view_or_value filter, const pipeline &update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
search_index_view search_indexes()
Gets a search_index_view to the collection.
stdx::optional< result::update > update_many(const client_session &session, bsoncxx::document::view_or_value filter, const pipeline &update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
stdx::optional< result::replace_one > replace_one(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value replacement, const options::replace &options=options::replace{})
Replaces a single document matching the provided filter in this collection.
stdx::optional< result::update > update_many(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
cursor distinct(bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value filter, const options::distinct &options=options::distinct())
Finds the distinct values for a specified field across the collection.
stdx::optional< bsoncxx::document::value > find_one(bsoncxx::document::view_or_value filter, const options::find &options=options::find())
Finds a single document in this collection that match the provided filter.
void drop(const bsoncxx::stdx::optional< mongocxx::write_concern > &write_concern={}, bsoncxx::document::view_or_value collection_options={})
Drops this collection and all its contained documents from the database.
stdx::optional< result::delete_result > delete_many(bsoncxx::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes all matching documents from the collection.
cursor distinct(const client_session &session, bsoncxx::string::view_or_value name, bsoncxx::document::view_or_value filter, const options::distinct &options=options::distinct())
Finds the distinct values for a specified field across the collection.
void rename(const client_session &session, bsoncxx::string::view_or_value new_name, bool drop_target_before_rename=false, const bsoncxx::stdx::optional< write_concern > &write_concern={})
Rename this collection.
stdx::optional< bsoncxx::document::value > find_one_and_update(bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
stdx::optional< result::update > update_one(const client_session &session, bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
stdx::string_view name() const
Returns the name of this collection.
stdx::optional< bsoncxx::document::value > find_one_and_delete(const client_session &session, bsoncxx::document::view_or_value filter, const options::find_one_and_delete &options=options::find_one_and_delete())
Finds a single document matching the filter, deletes it, and returns the original.
stdx::optional< bsoncxx::document::value > find_one_and_delete(bsoncxx::document::view_or_value filter, const options::find_one_and_delete &options=options::find_one_and_delete())
Finds a single document matching the filter, deletes it, and returns the original.
stdx::optional< result::update > update_one(bsoncxx::document::view_or_value filter, const pipeline &update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
bsoncxx::document::value create_index(bsoncxx::document::view_or_value keys, bsoncxx::document::view_or_value index_options={}, options::index_view operation_options=options::index_view{})
Creates an index over the collection for the provided keys with the provided options.
stdx::optional< result::update > update_one(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
change_stream watch(const client_session &session, const options::change_stream &options={})
stdx::optional< bsoncxx::document::value > find_one_and_replace(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value replacement, const options::find_one_and_replace &options=options::find_one_and_replace())
Finds a single document matching the filter, replaces it, and returns either the original or the repl...
stdx::optional< result::delete_result > delete_many(const client_session &session, bsoncxx::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes all matching documents from the collection.
stdx::optional< result::delete_result > delete_one(const client_session &session, bsoncxx::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes a single matching document from the collection.
change_stream watch(const options::change_stream &options={})
Gets a change stream on this collection with an empty pipeline.
stdx::optional< bsoncxx::document::value > find_one_and_update(const client_session &session, bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
stdx::optional< result::update > update_many(const client_session &session, bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
cursor list_indexes() const
Returns a list of the indexes currently on this collection.
stdx::optional< bsoncxx::document::value > find_one_and_update(bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
change_stream watch(const client_session &session, const pipeline &pipe, const options::change_stream &options={})
Gets a change stream on this collection.
void write_concern(class write_concern wc)
Sets the write_concern for this collection.
stdx::optional< result::update > update_many(bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
stdx::optional< bsoncxx::document::value > find_one_and_replace(const client_session &session, bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value replacement, const options::find_one_and_replace &options=options::find_one_and_replace())
Finds a single document matching the filter, replaces it, and returns either the original or the repl...
std::int64_t count_documents(const client_session &session, bsoncxx::document::view_or_value filter, const options::count &options=options::count())
Counts the number of documents matching the provided filter.
stdx::optional< result::update > update_one(const client_session &session, bsoncxx::document::view_or_value filter, const pipeline &update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
void read_concern(class read_concern rc)
Sets the read_concern for this collection.
stdx::optional< result::insert_one > insert_one(const client_session &session, bsoncxx::document::view_or_value document, const options::insert &options={})
Inserts a single document into the collection.
stdx::optional< bsoncxx::document::value > find_one_and_update(const client_session &session, bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
index_view indexes()
Gets an index_view to the collection.
void read_preference(class read_preference rp)
Sets the read_preference for this collection.
stdx::optional< result::delete_result > delete_one(bsoncxx::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes a single matching document from the collection.
stdx::optional< result::update > update_one(bsoncxx::document::view_or_value filter, std::initializer_list< _empty_doc_tag > update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
stdx::optional< result::insert_one > insert_one(bsoncxx::document::view_or_value document, const options::insert &options={})
Inserts a single document into the collection.
collection() noexcept
Default constructs a collection object.
stdx::optional< bsoncxx::document::value > find_one_and_update(const client_session &session, bsoncxx::document::view_or_value filter, const pipeline &update, const options::find_one_and_update &options=options::find_one_and_update())
Finds a single document matching the filter, updates it, and returns either the original or the newly...
std::int64_t count_documents(bsoncxx::document::view_or_value filter, const options::count &options=options::count())
Counts the number of documents matching the provided filter.
cursor find(const client_session &session, bsoncxx::document::view_or_value filter, const options::find &options=options::find())
Finds the documents in this collection which match the provided filter.
cursor find(bsoncxx::document::view_or_value filter, const options::find &options=options::find())
Finds the documents in this collection which match the provided filter.
void drop(const client_session &session, const bsoncxx::stdx::optional< mongocxx::write_concern > &write_concern={}, bsoncxx::document::view_or_value collection_options={})
Drops this collection and all its contained documents from the database.
cursor list_indexes(const client_session &session) const
Returns a list of the indexes currently on this collection.
void rename(bsoncxx::string::view_or_value new_name, bool drop_target_before_rename=false, const bsoncxx::stdx::optional< write_concern > &write_concern={})
Rename this collection.
stdx::optional< bsoncxx::document::value > find_one(const client_session &session, bsoncxx::document::view_or_value filter, const options::find &options=options::find())
Finds a single document in this collection that match the provided filter.
std::int64_t estimated_document_count(const options::estimated_document_count &options=options::estimated_document_count())
Returns an estimate of the number of documents in the collection.
stdx::optional< result::replace_one > replace_one(const client_session &session, bsoncxx::document::view_or_value filter, bsoncxx::document::view_or_value replacement, const options::replace &options=options::replace{})
Replaces a single document matching the provided filter in this collection.
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
Class representing a MongoDB index view.
Definition index_view.hpp:34
Class representing a MongoDB update operation that replaces a single document.
Definition replace_one.hpp:31
Models a single write operation within a mongocxx::bulk_write.
Definition write.hpp:37
Class representing the optional arguments to a MongoDB aggregation operation.
Definition aggregate.hpp:39
Class representing the optional arguments to a MongoDB bulk write.
Definition bulk_write.hpp:31
Class representing MongoDB change stream options.
Definition change_stream.hpp:38
Class representing the optional arguments to mongocxx::collection::count_documents.
Definition count.hpp:36
Class representing the optional arguments to a MongoDB delete operation.
Definition delete.hpp:32
Class representing the optional arguments to a MongoDB distinct command.
Definition distinct.hpp:35
Class representing the optional arguments to mongocxx::collection::estimated_document_count.
Definition estimated_document_count.hpp:32
Class representing the optional arguments to a MongoDB find_and_modify delete operation.
Definition find_one_and_delete.hpp:35
Class representing the optional arguments to a MongoDB find_and_modify replace operation.
Definition find_one_and_replace.hpp:37
Class representing the optional arguments to a MongoDB find_and_modify update operation.
Definition find_one_and_update.hpp:38
Class representing the optional arguments to a MongoDB query.
Definition find.hpp:37
Class representing optional arguments to IndexView operations.
Definition index_view.hpp:31
Class representing the optional arguments to a MongoDB insert operation.
Definition insert.hpp:32
Class representing the optional arguments to a MongoDB replace operation.
Definition replace.hpp:34
Class representing the optional arguments to a MongoDB update operation.
Definition update.hpp:34
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 a MongoDB search index view.
Definition search_index_view.hpp:19
Class representing the server-side requirement for reporting the success of a write operation.
Definition write_concern.hpp:59
The top-level namespace for mongocxx library entities.
Definition bulk_write.hpp:24