100 class _empty_doc_tag {};
298 template <
typename container_type>
301 return bulk_write(writes.begin(), writes.end(), options);
328 template <
typename container_type>
331 const container_type& writes,
333 return bulk_write(session, writes.begin(), writes.end(), options);
359 template <
typename write_model_iterator_type>
361 write_model_iterator_type begin,
362 write_model_iterator_type end,
365 std::for_each(begin, end, [&](
const model::write& current) { writes.append(current); });
366 return writes.execute();
394 template <
typename write_model_iterator_type>
397 write_model_iterator_type begin,
398 write_model_iterator_type end,
401 std::for_each(begin, end, [&](
const model::write& current) { writes.append(current); });
402 return writes.execute();
430 const options::count& options = options::count());
456 bsoncxx::v_noabi::document::view_or_value filter,
457 const options::count& options = options::count());
500 bsoncxx::v_noabi::document::view_or_value index_options = {},
526 bsoncxx::v_noabi::document::view_or_value keys,
527 bsoncxx::v_noabi::document::view_or_value index_options = {},
549 const options::delete_options& options = options::delete_options());
572 bsoncxx::v_noabi::document::view_or_value filter,
573 const options::delete_options& options = options::delete_options());
594 const options::delete_options& options = options::delete_options());
617 bsoncxx::v_noabi::document::view_or_value filter,
618 const options::delete_options& options = options::delete_options());
639 bsoncxx::v_noabi::document::view_or_value filter,
664 bsoncxx::v_noabi::document::view_or_value filter,
737 const options::
find& options = options::
find());
761 bsoncxx::v_noabi::document::view_or_value filter,
762 const options::
find& options = options::
find());
781 const options::
find& options = options::
find());
802 bsoncxx::v_noabi::document::view_or_value filter,
803 const options::
find& options = options::
find());
824 bsoncxx::v_noabi::document::view_or_value filter,
849 bsoncxx::v_noabi::document::view_or_value filter,
874 bsoncxx::v_noabi::document::view_or_value filter,
875 bsoncxx::v_noabi::document::view_or_value replacement,
903 bsoncxx::v_noabi::document::view_or_value filter,
904 bsoncxx::v_noabi::document::view_or_value replacement,
929 bsoncxx::v_noabi::document::view_or_value filter,
930 bsoncxx::v_noabi::document::view_or_value update,
955 bsoncxx::v_noabi::document::view_or_value filter,
981 bsoncxx::v_noabi::document::view_or_value filter,
982 std::initializer_list<_empty_doc_tag> update,
1010 bsoncxx::v_noabi::document::view_or_value filter,
1011 bsoncxx::v_noabi::document::view_or_value update,
1039 bsoncxx::v_noabi::document::view_or_value filter,
1068 bsoncxx::v_noabi::document::view_or_value filter,
1069 std::initializer_list<_empty_doc_tag> update,
1089 const options::insert& options = {});
1111 bsoncxx::v_noabi::document::view_or_value document,
1112 const options::insert& options = {});
1137 template <
typename container_type>
1140 return insert_many(container.begin(), container.end(), options);
1164 template <
typename container_type>
1167 const container_type& container,
1169 return insert_many(session, container.begin(), container.end(), options);
1195 template <
typename document_view_iterator_type>
1197 document_view_iterator_type begin,
1198 document_view_iterator_type end,
1200 return _insert_many(
nullptr, begin, end, options);
1224 template <
typename document_view_iterator_type>
1227 document_view_iterator_type begin,
1228 document_view_iterator_type end,
1230 return _insert_many(&session, begin, end, options);
1290 bool drop_target_before_rename = false,
1316 bsoncxx::v_noabi::
string::view_or_value new_name,
1317 bool drop_target_before_rename = false,
1387 bsoncxx::v_noabi::document::view_or_value replacement,
1388 const options::replace& options = options::replace{});
1415 bsoncxx::v_noabi::document::view_or_value filter,
1416 bsoncxx::v_noabi::document::view_or_value replacement,
1417 const options::replace& options = options::replace{});
1442 bsoncxx::v_noabi::document::view_or_value update,
1443 const options::update& options = options::update());
1469 const options::update& options = options::update());
1494 std::initializer_list<_empty_doc_tag> update,
1495 const options::update& options = options::update());
1522 bsoncxx::v_noabi::document::view_or_value filter,
1523 bsoncxx::v_noabi::document::view_or_value update,
1524 const options::update& options = options::update());
1551 bsoncxx::v_noabi::document::view_or_value filter,
1553 const options::update& options = options::update());
1580 bsoncxx::v_noabi::document::view_or_value filter,
1581 std::initializer_list<_empty_doc_tag> update,
1582 const options::update& options = options::update());
1607 bsoncxx::v_noabi::document::view_or_value update,
1608 const options::update& options = options::update());
1634 const options::update& options = options::update());
1659 std::initializer_list<_empty_doc_tag> update,
1660 const options::update& options = options::update());
1687 bsoncxx::v_noabi::document::view_or_value filter,
1688 bsoncxx::v_noabi::document::view_or_value update,
1689 const options::update& options = options::update());
1716 bsoncxx::v_noabi::document::view_or_value filter,
1718 const options::update& options = options::update());
1745 bsoncxx::v_noabi::document::view_or_value filter,
1746 std::initializer_list<_empty_doc_tag> update,
1747 const options::update& options = options::update());
1848 friend ::mongocxx::v_noabi::bulk_write;
1849 friend ::mongocxx::v_noabi::client_encryption;
1850 friend ::mongocxx::v_noabi::database;
1928 bool drop_target_before_rename,
1971 template <
typename document_view_iterator_type>
1974 document_view_iterator_type begin,
1975 document_view_iterator_type end,
1978 auto writes = _init_insert_many(options, session);
1981 _insert_many_doc_handler(writes, inserted_ids, doc);
1983 return _exec_insert_many(writes, inserted_ids);
1989 const impl& _get_impl()
const;
1991 std::unique_ptr<impl> _impl;
Provides mongocxx::v_noabi::options::aggregate.
Provides bsoncxx::v_noabi::builder::basic::array.
Provides bsoncxx::v_noabi::builder::basic::document.
Declares mongocxx::v_noabi::bulk_write.
Provides mongocxx::v_noabi::bulk_write.
Provides mongocxx::v_noabi::change_stream.
A traditional builder-style interface for constructing a BSON array.
Definition array.hpp:37
A read-only BSON document that owns its underlying buffer. When a document::value goes out of scope,...
Definition value.hpp:38
A read-only, non-owning view of a BSON document.
Definition view.hpp:35
A polyfill for std::optional<T>.
Definition optional.hpp:826
A polyfill for std::string_view.
Definition string_view.hpp:436
Class representing a view-or-value variant type for strings.
Definition view_or_value.hpp:41
mongocxx::v_noabi::cursor
Definition cursor-fwd.hpp:45
Class representing a batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:45
bsoncxx::v_noabi::stdx::optional< result::bulk_write > execute() const
Executes a bulk write.
bulk_write & append(const model::write &operation)
Appends a single write to the bulk write operation. The write operation's contents are copied into th...
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:48
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:87
mongocxx::v_noabi::read_preference read_preference() const
Gets the read_preference for the collection.
std::int64_t count_documents(bsoncxx::v_noabi::document::view_or_value filter, const options::count &options=options::count())
Counts the number of documents matching the provided filter.
bsoncxx::v_noabi::stdx::optional< result::replace_one > replace_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, const options::replace &options=options::replace{})
Replaces a single document matching the provided filter in this collection.
search_index_view search_indexes()
Gets a search_index_view to the collection.
bsoncxx::v_noabi::stdx::optional< result::update > update_many(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, const options::update &options=options::update())
Updates multiple documents matching the provided filter in this collection.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one_and_replace(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::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...
void read_concern(mongocxx::v_noabi::read_concern rc)
Sets the read_concern for this collection. Changes will not have any effect on existing cursors or ot...
bsoncxx::v_noabi::document::value create_index(bsoncxx::v_noabi::document::view_or_value keys, bsoncxx::v_noabi::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.
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(const client_session &session, const container_type &container, const options::insert &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1165
cursor aggregate(const pipeline &pipeline, const options::aggregate &options=options::aggregate())
Runs an aggregation framework pipeline against this collection.
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(const client_session &session, write_model_iterator_type begin, write_model_iterator_type end, const options::bulk_write &options=options::bulk_write())
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:395
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(document_view_iterator_type begin, document_view_iterator_type end, const options::insert &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1196
change_stream watch(const options::change_stream &options={})
Gets a change stream on this collection with an empty pipeline. Change streams are only supported wit...
void drop(const bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > &write_concern={}, bsoncxx::v_noabi::document::view_or_value collection_options={})
Drops this collection and all its contained documents from the database.
bsoncxx::v_noabi::stdx::optional< result::delete_result > delete_many(bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes all matching documents from the collection.
cursor list_indexes() const
Returns a list of the indexes currently on this collection.
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(const client_session &session, const container_type &writes, const options::bulk_write &options=options::bulk_write())
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:329
cursor distinct(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value filter, const options::distinct &options=options::distinct())
Finds the distinct values for a specified field across the collection.
bsoncxx::v_noabi::stdx::optional< result::delete_result > delete_one(bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options &options=options::delete_options())
Deletes a single matching document from the collection.
bsoncxx::v_noabi::stdx::string_view name() const
Returns the name of this collection.
mongocxx::v_noabi::read_concern read_concern() const
Gets the read_concern for the collection.
void read_preference(mongocxx::v_noabi::read_preference rp)
Sets the read_preference for this collection. Changes will not have any effect on existing cursors or...
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(const container_type &writes, const options::bulk_write &options=options::bulk_write())
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:299
bsoncxx::v_noabi::stdx::optional< result::bulk_write > write(const model::write &write, const options::bulk_write &options=options::bulk_write())
Sends a write to the server as a bulk write operation.
Definition collection.hpp:242
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(write_model_iterator_type begin, write_model_iterator_type end, const options::bulk_write &options=options::bulk_write())
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:360
void rename(bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename=false, const bsoncxx::v_noabi::stdx::optional< write_concern > &write_concern={})
Rename this collection.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one_and_delete(bsoncxx::v_noabi::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.
index_view indexes()
Gets an index_view to the collection.
mongocxx::v_noabi::bulk_write create_bulk_write(const options::bulk_write &options={})
Creates a new bulk operation to be executed against this collection. The lifetime of the bulk_write i...
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(const container_type &container, const options::insert &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1138
collection() noexcept
Default constructs a collection object. The collection is equivalent to the state of a moved from col...
cursor find(bsoncxx::v_noabi::document::view_or_value filter, const options::find &options=options::find())
Finds the documents in this collection which match the provided filter.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one_and_update(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::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...
cursor list_indexes(const client_session &session) const
Returns a list of the indexes currently on this collection.
bsoncxx::v_noabi::stdx::optional< result::insert_one > insert_one(bsoncxx::v_noabi::document::view_or_value document, const options::insert &options={})
Inserts a single document into the collection. If the document is missing an identifier (_id field) o...
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(const client_session &session, document_view_iterator_type begin, document_view_iterator_type end, const options::insert &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1225
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.
bsoncxx::v_noabi::stdx::optional< result::update > update_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, const options::update &options=options::update())
Updates a single document matching the provided filter in this collection.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one(bsoncxx::v_noabi::document::view_or_value filter, const options::find &options=options::find())
Finds a single document in this collection that match the provided filter.
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
Class representing a MongoDB index view.
Definition index_view.hpp:39
Class representing a MongoDB update operation that replaces a single document.
Definition replace_one.hpp:33
Models a single write operation within a mongocxx::v_noabi::bulk_write.
Definition write.hpp:40
Class representing the optional arguments to a MongoDB aggregation operation.
Definition aggregate.hpp:43
Class representing the optional arguments to a MongoDB bulk write.
Definition bulk_write.hpp:34
Class representing MongoDB change stream options.
Definition change_stream.hpp:38
Class representing the optional arguments to mongocxx::v_noabi::collection::count_documents.
Definition count.hpp:39
Class representing the optional arguments to a MongoDB delete operation.
Definition delete.hpp:35
Class representing the optional arguments to a MongoDB distinct command.
Definition distinct.hpp:38
Class representing the optional arguments to a MongoDB find_and_modify delete operation.
Definition find_one_and_delete.hpp:38
Class representing the optional arguments to a MongoDB find_and_modify replace operation.
Definition find_one_and_replace.hpp:39
Class representing the optional arguments to a MongoDB find_and_modify update operation.
Definition find_one_and_update.hpp:40
Class representing the optional arguments to a MongoDB query.
Definition find.hpp:40
Class representing optional arguments to IndexView operations.
Definition index_view.hpp:35
Class representing the optional arguments to a MongoDB insert operation.
Definition insert.hpp:34
Class representing the optional arguments to a MongoDB replace operation.
Definition replace.hpp:36
Class representing the optional arguments to a MongoDB update operation.
Definition update.hpp:36
Class representing a MongoDB aggregation pipeline.
Definition pipeline.hpp:39
A class to represent the read concern. Read concern can be set at the client, database,...
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:64
Class representing a MongoDB search index view.
Definition search_index_view.hpp:24
Class representing the server-side requirement for reporting the success of a write operation....
Definition write_concern.hpp:60
Declares mongocxx::v_noabi::client_encryption.
Provides mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Provides concatenators for use with "streaming" BSON builder syntax.
Provides mongocxx::v_noabi::options::count.
Provides mongocxx::v_noabi::cursor.
Declares mongocxx::v_noabi::database.
Provides mongocxx::v_noabi::options::distinct.
Provides bsoncxx::v_noabi::document::view_or_value.
Provides mongocxx::v_noabi::options::estimated_document_count.
Provides mongocxx::v_noabi::options::find.
Provides mongocxx::v_noabi::options::find_one_and_delete.
Provides mongocxx::v_noabi::options::find_one_and_replace.
Provides mongocxx::v_noabi::options::find_one_and_update.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:204
Provides mongocxx::v_noabi::options::index.
Provides mongocxx::v_noabi::index_view.
Provides mongocxx::v_noabi::options::insert.
Provides mongocxx::v_noabi::result::insert_many.
Declares bsoncxx::v_noabi::builder::basic::kvp.
Provides mongocxx::v_noabi::model::insert_one.
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides bsoncxx::v_noabi::oid.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::options::bulk_write.
Provides mongocxx::v_noabi::options::change_stream.
Provides mongocxx::v_noabi::options::delete_options.
Provides mongocxx::v_noabi::options::index_view.
Provides mongocxx::v_noabi::options::update.
Provides mongocxx::v_noabi::pipeline.
Provides mongocxx::v_noabi::read_concern.
Provides mongocxx::v_noabi::read_preference.
Provides mongocxx::v_noabi::options::replace.
Provides mongocxx::v_noabi::result::bulk_write.
Provides mongocxx::v_noabi::result::delete_result.
Provides mongocxx::v_noabi::result::insert_one.
Provides mongocxx::v_noabi::result::replace_one.
Provides mongocxx::v_noabi::result::update.
Provides mongocxx::v_noabi::search_index_view.
Provides bsoncxx::v_noabi::string::view_or_value.
Provides mongocxx::v_noabi::write_concern.