100 class _empty_doc_tag {};
300 template <
typename container_type>
302 container_type
const& writes,
331 template <
typename container_type>
334 container_type
const& writes,
362 template <
typename write_model_iterator_type>
364 write_model_iterator_type begin,
365 write_model_iterator_type end,
368 std::for_each(begin, end, [&](
model::write const& current) { writes.append(current); });
369 return writes.execute();
397 template <
typename write_model_iterator_type>
400 write_model_iterator_type begin,
401 write_model_iterator_type end,
404 std::for_each(begin, end, [&](
model::write const& current) { writes.append(current); });
405 return writes.execute();
992 std::initializer_list<_empty_doc_tag> update,
1079 std::initializer_list<_empty_doc_tag> update,
1147 template <
typename container_type>
1149 container_type
const& container,
1175 template <
typename container_type>
1178 container_type
const& container,
1206 template <
typename document_view_iterator_type>
1208 document_view_iterator_type begin,
1209 document_view_iterator_type end,
1211 return _insert_many(
nullptr, begin, end,
options);
1235 template <
typename document_view_iterator_type>
1238 document_view_iterator_type begin,
1239 document_view_iterator_type end,
1241 return _insert_many(&session, begin, end,
options);
1302 bool drop_target_before_rename = false,
1330 bool drop_target_before_rename = false,
1512 std::initializer_list<_empty_doc_tag> update,
1602 std::initializer_list<_empty_doc_tag> update,
1683 std::initializer_list<_empty_doc_tag> update,
1773 std::initializer_list<_empty_doc_tag> update,
1873 friend ::mongocxx::v_noabi::bulk_write;
1874 friend ::mongocxx::v_noabi::client_encryption;
1875 friend ::mongocxx::v_noabi::database;
1883 std::int64_t _count(
1888 std::int64_t _count_documents(
1955 bool drop_target_before_rename,
1988 _insert_many_doc_handler(
1996 template <
typename document_view_iterator_type>
1999 document_view_iterator_type begin,
2000 document_view_iterator_type end,
2003 auto writes = _init_insert_many(
options, session);
2005 _insert_many_doc_handler(writes, inserted_ids, doc);
2007 return _exec_insert_many(writes, inserted_ids);
2013 impl
const& _get_impl()
const;
2015 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 polyfill for std::optional<T>.
Definition optional.hpp:800
A polyfill for std::string_view.
Definition string_view.hpp:411
A traditional builder-style interface for constructing a BSON array.
Definition array.hpp:37
A read-only BSON document that owns its underlying buffer.
Definition value.hpp:39
A read-only, non-owning view of a BSON document.
Definition view.hpp:35
A view-or-value variant type for strings.
Definition view_or_value.hpp:41
collection() noexcept
Default constructs a collection object. The collection is equivalent to the state of a moved from col...
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(model::write const &operation)
Appends a single write to the bulk write operation. The write operation's contents are copied into th...
A MongoDB change stream.
Definition change_stream.hpp:35
Supports MongoDB client session operations.
Definition client_session.hpp:50
mongocxx::v_noabi::read_preference read_preference() const
Gets the read_preference for the collection.
void drop(bsoncxx::v_noabi::stdx::optional< mongocxx::v_noabi::write_concern > const &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::insert_many > insert_many(container_type const &container, options::insert const &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1148
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(client_session const &session, document_view_iterator_type begin, document_view_iterator_type end, options::insert const &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1236
search_index_view search_indexes()
Gets a search_index_view to the collection.
bsoncxx::v_noabi::stdx::optional< result::insert_one > insert_one(bsoncxx::v_noabi::document::view_or_value document, options::insert const &options={})
Inserts a single document into the collection. If the document is missing an identifier (_id field) o...
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, options::find_one_and_replace const &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...
cursor list_indexes(client_session const &session) const
Returns a list of the indexes currently on this collection.
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< bsoncxx::v_noabi::document::value > find_one(bsoncxx::v_noabi::document::view_or_value filter, options::find const &options=options::find())
Finds a single document in this collection that match the provided filter.
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(client_session const &session, write_model_iterator_type begin, write_model_iterator_type end, options::bulk_write const &options=options::bulk_write())
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:398
void write_concern(mongocxx::v_noabi::write_concern wc)
Sets the write_concern for this collection. Changes will not have any effect on existing write operat...
void rename(bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename=false, bsoncxx::v_noabi::stdx::optional< write_concern > const &write_concern={})
Rename this collection.
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(client_session const &session, container_type const &container, options::insert const &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1176
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(client_session const &session, container_type const &writes, options::bulk_write const &options=options::bulk_write())
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:332
bsoncxx::v_noabi::stdx::optional< result::bulk_write > write(model::write const &write, options::bulk_write const &options=options::bulk_write())
Sends a write to the server as a bulk write operation.
Definition collection.hpp:243
cursor find(bsoncxx::v_noabi::document::view_or_value filter, options::find const &options=options::find())
Finds the documents in this collection which match the provided filter.
cursor list_indexes() const
Returns a list of the indexes currently on this collection.
bsoncxx::v_noabi::stdx::string_view name() const
Returns the name of this collection.
bsoncxx::v_noabi::stdx::optional< result::delete_result > delete_many(bsoncxx::v_noabi::document::view_or_value filter, options::delete_options const &options=options::delete_options())
Deletes all matching documents from the collection.
bsoncxx::v_noabi::stdx::optional< result::delete_result > delete_one(bsoncxx::v_noabi::document::view_or_value filter, options::delete_options const &options=options::delete_options())
Deletes a single matching document from the collection.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one_and_delete(bsoncxx::v_noabi::document::view_or_value filter, options::find_one_and_delete const &options=options::find_one_and_delete())
Finds a single document matching the filter, deletes it, and returns the original.
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...
change_stream watch(options::change_stream const &options={})
Gets a change stream on this collection with an empty pipeline. Change streams are only supported wit...
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, options::replace const &options=options::replace{})
Replaces a single document matching the provided filter in this collection.
bsoncxx::v_noabi::stdx::optional< result::bulk_write > bulk_write(write_model_iterator_type begin, write_model_iterator_type end, options::bulk_write const &options=options::bulk_write())
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:363
index_view indexes()
Gets an index_view to 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, options::update const &options=options::update())
Updates a single document matching the provided filter in this collection.
cursor distinct(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value filter, options::distinct const &options=options::distinct())
Finds the distinct values for a specified field across the collection.
bsoncxx::v_noabi::stdx::optional< result::insert_many > insert_many(document_view_iterator_type begin, document_view_iterator_type end, options::insert const &options=options::insert())
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1207
std::int64_t count_documents(bsoncxx::v_noabi::document::view_or_value filter, options::count const &options=options::count())
Counts the number of documents matching the provided filter.
collection() noexcept
Default constructs a collection object. The collection is equivalent to the state of a moved from col...
cursor aggregate(pipeline const &pipeline, options::aggregate const &options=options::aggregate())
Runs an aggregation framework pipeline against this collection.
mongocxx::v_noabi::bulk_write create_bulk_write(options::bulk_write const &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::bulk_write > bulk_write(container_type const &writes, options::bulk_write const &options=options::bulk_write())
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:301
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, options::update const &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_update(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, options::find_one_and_update const &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 estimated_document_count(options::estimated_document_count const &options=options::estimated_document_count())
Returns an estimate of the number of documents in the collection.
A cursor over the documents returned by a query to a MongoDB server.
Definition cursor.hpp:42
A MongoDB database.
Definition database.hpp:46
A MongoDB index.
Definition index_view.hpp:42
A MongoDB update operation that replaces a single document.
Definition replace_one.hpp:33
A single write operation for use with mongocxx::v_noabi::bulk_write.
Definition write.hpp:40
Used by MongoDB aggregation operations.
Definition aggregate.hpp:43
Used by mongocxx::v_noabi::collection.
Definition bulk_write.hpp:34
Used by change streams.
Definition change_stream.hpp:38
Used by mongocxx::v_noabi::collection::count_documents.
Definition count.hpp:39
Used by MongoDB delete operations.
Definition delete.hpp:35
Used by mongocxx::v_noabi::collection.
Definition distinct.hpp:38
Used by mongocxx::v_noabi::collection.
Definition find_one_and_delete.hpp:38
Used by mongocxx::v_noabi::collection.
Definition find_one_and_replace.hpp:39
Used by mongocxx::v_noabi::collection.
Definition find_one_and_update.hpp:40
Used by MongoDB find operations.
Definition find.hpp:40
Used by MongoDB index view operations.
Definition index_view.hpp:35
Used by mongocxx::v_noabi::collection.
Definition insert.hpp:34
Used by mongocxx::v_noabi::collection.
Definition replace.hpp:36
Used by mongocxx::v_noabi::collection.
Definition update.hpp:36
A MongoDB aggregation pipeline.
Definition pipeline.hpp:39
Controls the consistency and isolation properties of data read from replica sets and sharded clusters...
Definition read_concern.hpp:48
Describes how MongoDB clients route read operations to the members of a replica set or sharded cluste...
Definition read_preference.hpp:49
A MongoDB Atlas Search Index.
Definition search_index_view.hpp:26
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.
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.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
v_noabi::view_or_value< v_noabi::document::view, v_noabi::document::value > view_or_value
Equivalent to v_noabi::view_or_value<v_noabi::document::view, v_noabi::document::value>.
Definition view_or_value.hpp:30
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing bulk write operations.
Declares entities representing options to use with various commands.
Declares entities representing the result of various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Provides bsoncxx::v_noabi::oid.
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 std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::write_concern.