MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
collection.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <mongocxx/collection-fwd.hpp> // IWYU pragma: export
18
19//
20
21#include <mongocxx/v1/collection.hpp> // IWYU pragma: export
22
23#include <algorithm>
24#include <cstdint>
25#include <initializer_list>
26#include <string> // IWYU pragma: keep: backward compatibility, to be removed.
27#include <utility>
28
30#include <mongocxx/client_encryption-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
31#include <mongocxx/database-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
32
34#include <bsoncxx/builder/basic/document.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
35#include <bsoncxx/builder/basic/kvp.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
36#include <bsoncxx/builder/concatenate.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
39#include <bsoncxx/oid.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
43
47#include <mongocxx/cursor.hpp>
49#include <mongocxx/model/insert_one.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
62#include <mongocxx/options/index.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
67#include <mongocxx/pipeline.hpp>
78
80
81namespace mongocxx {
82namespace v_noabi {
83
99 private:
100 v1::collection _coll;
101
102 //
103 // Utility class supporting the convenience of {} meaning an empty bsoncxx::v_noabi::document.
104 //
105 // Users may not use this class directly.
106 //
107 // In places where driver methods take this class as a parameter, passing {} will
108 // translate to a default-constructed bsoncxx::v_noabi::document::view_or_value,
109 // regardless of other overloads taking other default-constructible types
110 // for that parameter. This class avoids compiler ambiguity with such overloads.
111 //
112 // See collection::update_one for an example of such overloads.
113 //
114 class _empty_doc_tag {};
115
116 public:
123 collection() noexcept {}
124
128 collection(collection&& other) noexcept = default;
129
133 collection& operator=(collection&& other) noexcept = default;
134
139
144
148 ~collection() = default;
149
153 /* explicit(false) */ collection(v1::collection collection) : _coll{std::move(collection)} {}
154
163 explicit operator v1::collection() && {
164 return std::move(_coll);
165 }
166
170 explicit operator v1::collection() const& {
171 return _coll;
172 }
173
178 explicit MONGOCXX_ABI_EXPORT_CDECL() operator bool() const noexcept;
179
202
227 v_noabi::client_session const& session,
228 v_noabi::pipeline const& pipeline,
229 v_noabi::options::aggregate const& options = {});
230
243
258
285
315
338 template <typename container_type>
340 container_type const& writes,
342 return this->bulk_write(writes.begin(), writes.end(), options);
343 }
344
369 template <typename container_type>
371 v_noabi::client_session const& session,
372 container_type const& writes,
374 return this->bulk_write(session, writes.begin(), writes.end(), options);
375 }
376
400 template <typename write_model_iterator_type>
402 write_model_iterator_type begin,
403 write_model_iterator_type end,
405 auto writes = create_bulk_write(options);
406 std::for_each(begin, end, [&](model::write const& current) { writes.append(current); });
407 return writes.execute();
408 }
409
435 template <typename write_model_iterator_type>
437 v_noabi::client_session const& session,
438 write_model_iterator_type begin,
439 write_model_iterator_type end,
441 auto writes = create_bulk_write(session, options);
442 std::for_each(begin, end, [&](model::write const& current) { writes.append(current); });
443 return writes.execute();
444 }
445
469 MONGOCXX_ABI_EXPORT_CDECL(std::int64_t)
470 count_documents(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::count const& options = {});
471
494 MONGOCXX_ABI_EXPORT_CDECL(std::int64_t)
496 v_noabi::client_session const& session,
497 bsoncxx::v_noabi::document::view_or_value filter,
498 v_noabi::options::count const& options = {});
499
516 MONGOCXX_ABI_EXPORT_CDECL(std::int64_t)
518
541 v_noabi::options::index_view operation_options = {}) {
542 using namespace bsoncxx::v_noabi::builder::basic;
543
544 auto const name_opt = this->indexes().create_one(keys, index_options, operation_options);
545
546 return name_opt ? make_document(kvp("name", *name_opt)) : make_document();
547 }
548
571 v_noabi::client_session const& session,
574 v_noabi::options::index_view operation_options = {}) {
575 using namespace bsoncxx::v_noabi::builder::basic;
576
577 auto const name_opt = this->indexes().create_one(session, keys, index_options, operation_options);
578
579 return name_opt ? make_document(kvp("name", *name_opt)) : make_document();
580 }
581
600 delete_many(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::delete_options const& options = {});
601
623 v_noabi::client_session const& session,
625 v_noabi::options::delete_options const& options = {});
626
645 delete_one(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::delete_options const& options = {});
646
668 v_noabi::client_session const& session,
670 v_noabi::options::delete_options const& options = {});
671
693 v_noabi::options::distinct const& options = {});
694
716 v_noabi::client_session const& session,
719 v_noabi::options::distinct const& options = {});
720
742 bsoncxx::v_noabi::stdx::optional<v_noabi::write_concern> const& write_concern = {},
743 bsoncxx::v_noabi::document::view_or_value collection_options = {});
744
767 v_noabi::client_session const& session,
768 bsoncxx::v_noabi::stdx::optional<v_noabi::write_concern> const& write_concern = {},
769 bsoncxx::v_noabi::document::view_or_value collection_options = {});
770
791
814 v_noabi::client_session const& session,
816 v_noabi::options::find const& options = {});
817
835
855 v_noabi::client_session const& session,
857 v_noabi::options::find const& options = {});
858
880
902 v_noabi::client_session const& session,
905
929 bsoncxx::v_noabi::document::view_or_value replacement,
931
956 v_noabi::client_session const& session,
958 bsoncxx::v_noabi::document::view_or_value replacement,
960
986
1010 v_noabi::pipeline const& update,
1012
1036 std::initializer_list<_empty_doc_tag> update,
1038
1063 v_noabi::client_session const& session,
1067
1092 v_noabi::client_session const& session,
1094 v_noabi::pipeline const& update,
1096
1121 v_noabi::client_session const& session,
1123 std::initializer_list<_empty_doc_tag> update,
1125
1143
1164 v_noabi::client_session const& session,
1166 v_noabi::options::insert const& options = {});
1167
1191 template <typename container_type>
1193 container_type const& container,
1194 v_noabi::options::insert const& options = {}) {
1195 return this->insert_many(container.begin(), container.end(), options);
1196 }
1197
1219 template <typename container_type>
1221 v_noabi::client_session const& session,
1222 container_type const& container,
1223 v_noabi::options::insert const& options = {}) {
1224 return this->insert_many(session, container.begin(), container.end(), options);
1225 }
1226
1250 template <typename document_view_iterator_type>
1252 document_view_iterator_type begin,
1253 document_view_iterator_type end,
1254 v_noabi::options::insert const& options = {}) {
1255 return this->_insert_many(nullptr, begin, end, options);
1256 }
1257
1279 template <typename document_view_iterator_type>
1281 v_noabi::client_session const& session,
1282 document_view_iterator_type begin,
1283 document_view_iterator_type end,
1284 v_noabi::options::insert const& options = {}) {
1285 return this->_insert_many(&session, begin, end, options);
1286 }
1287
1300
1315
1323
1345 bsoncxx::v_noabi::string::view_or_value new_name,
1346 bool drop_target_before_rename = false,
1347 bsoncxx::v_noabi::stdx::optional<v_noabi::write_concern> const& write_concern = {});
1348
1372 v_noabi::client_session const& session,
1373 bsoncxx::v_noabi::string::view_or_value new_name,
1374 bool drop_target_before_rename = false,
1375 bsoncxx::v_noabi::stdx::optional<v_noabi::write_concern> const& write_concern = {});
1376
1388
1398
1410
1420
1445 bsoncxx::v_noabi::document::view_or_value replacement,
1446 v_noabi::options::replace const& options = {});
1447
1473 v_noabi::client_session const& session,
1475 bsoncxx::v_noabi::document::view_or_value replacement,
1476 v_noabi::options::replace const& options = {});
1477
1503 v_noabi::options::update const& options = {});
1504
1529 v_noabi::pipeline const& update,
1530 v_noabi::options::update const& options = {});
1531
1556 std::initializer_list<_empty_doc_tag> update,
1557 v_noabi::options::update const& options = {});
1558
1584 v_noabi::client_session const& session,
1587 v_noabi::options::update const& options = {});
1588
1614 v_noabi::client_session const& session,
1616 v_noabi::pipeline const& update,
1617 v_noabi::options::update const& options = {});
1618
1644 v_noabi::client_session const& session,
1646 std::initializer_list<_empty_doc_tag> update,
1647 v_noabi::options::update const& options = {});
1648
1674 v_noabi::options::update const& options = {});
1675
1700 v_noabi::pipeline const& update,
1701 v_noabi::options::update const& options = {});
1702
1727 std::initializer_list<_empty_doc_tag> update,
1728 v_noabi::options::update const& options = {});
1729
1755 v_noabi::client_session const& session,
1758 v_noabi::options::update const& options = {});
1759
1785 v_noabi::client_session const& session,
1787 v_noabi::pipeline const& update,
1788 v_noabi::options::update const& options = {});
1789
1815 v_noabi::client_session const& session,
1817 std::initializer_list<_empty_doc_tag> update,
1818 v_noabi::options::update const& options = {});
1819
1828
1835
1840
1856
1871
1891
1910 v_noabi::client_session const& session,
1911 v_noabi::pipeline const& pipe,
1912 v_noabi::options::change_stream const& options = {});
1913
1918
1919 class internal;
1920
1921 private:
1923 _init_insert_many(v_noabi::options::insert const& options, v_noabi::client_session const* session);
1924
1926 _insert_many_doc_handler(
1927 v_noabi::bulk_write& writes,
1930
1932 _exec_insert_many(v_noabi::bulk_write& writes, bsoncxx::v_noabi::builder::basic::array& inserted_ids);
1933
1934 template <typename document_view_iterator_type>
1936 v_noabi::client_session const* session,
1937 document_view_iterator_type begin,
1938 document_view_iterator_type end,
1941 auto writes = _init_insert_many(options, session);
1942 std::for_each(begin, end, [&inserted_ids, &writes, this](bsoncxx::v_noabi::document::view doc) {
1943 _insert_many_doc_handler(writes, inserted_ids, doc);
1944 });
1945 return _exec_insert_many(writes, inserted_ids);
1946 }
1947};
1948
1949} // namespace v_noabi
1950} // namespace mongocxx
1951
1952namespace mongocxx {
1953namespace v_noabi {
1954
1959 return {std::move(v)};
1960}
1961
1966 return v1::collection{std::move(v)};
1967}
1968
1969} // namespace v_noabi
1970} // namespace mongocxx
1971
1973
Provides mongocxx::v_noabi::options::aggregate.
Provides bsoncxx::v_noabi::builder::basic::array.
Provides bsoncxx::v_noabi::builder::basic::document.
A polyfill for std::optional<T>.
Definition optional.hpp:799
A polyfill for std::string_view.
Definition string_view.hpp:412
A traditional builder-style interface for constructing a BSON array.
Definition array.hpp:37
A traditional builder-style interface for constructing a BSON document.
Definition document.hpp:41
A read-only BSON document that owns its underlying buffer.
Definition value.hpp:48
A read-only, non-owning view of a BSON document.
Definition view.hpp:40
A view-or-value variant type.
Definition view_or_value.hpp:32
collection() noexcept
Default constructs a collection object. The collection is equivalent to the state of a moved from col...
Definition collection.hpp:123
A MongoDB collection.
Definition collection.hpp:83
A batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:54
bsoncxx::v_noabi::stdx::optional< result::bulk_write > execute() const
Executes a bulk write.
bulk_write & append(v_noabi::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:44
Supports MongoDB client session operations.
Definition client_session.hpp:58
A MongoDB collection.
Definition collection.hpp:98
bsoncxx::v_noabi::stdx::optional< v_noabi::result::bulk_write > bulk_write(write_model_iterator_type begin, write_model_iterator_type end, v_noabi::options::bulk_write const &options={})
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:401
bsoncxx::v_noabi::stdx::optional< v_noabi::result::insert_many > insert_many(v_noabi::client_session const &session, container_type const &container, v_noabi::options::insert const &options={})
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1220
void read_concern(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::stdx::optional< v_noabi::result::bulk_write > bulk_write(v_noabi::client_session const &session, write_model_iterator_type begin, write_model_iterator_type end, v_noabi::options::bulk_write const &options={})
Sends writes starting at begin and ending at end to the server as a bulk write operation.
Definition collection.hpp:436
bsoncxx::v_noabi::stdx::optional< v_noabi::result::replace_one > replace_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value replacement, v_noabi::options::replace const &options={})
Replaces a single document matching the provided filter in this collection.
void write_concern(v_noabi::write_concern wc)
Sets the write_concern for this collection. Changes will not have any effect on existing write operat...
bsoncxx::v_noabi::document::value create_index(bsoncxx::v_noabi::document::view_or_value keys, bsoncxx::v_noabi::document::view_or_value index_options={}, v_noabi::options::index_view operation_options={})
Creates an index over the collection for the provided keys with the provided options.
Definition collection.hpp:538
v_noabi::cursor list_indexes() const
Returns a list of the indexes currently on this collection.
bsoncxx::v_noabi::document::value create_index(v_noabi::client_session const &session, bsoncxx::v_noabi::document::view_or_value keys, bsoncxx::v_noabi::document::view_or_value index_options={}, v_noabi::options::index_view operation_options={})
Creates an index over the collection for the provided keys with the provided options.
Definition collection.hpp:570
void drop(bsoncxx::v_noabi::stdx::optional< 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.
v_noabi::cursor find(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::find const &options={})
Finds the documents in this collection which match the provided filter.
v_noabi::search_index_view search_indexes()
Gets a search_index_view to the collection.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::bulk_write > bulk_write(container_type const &writes, v_noabi::options::bulk_write const &options={})
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:339
bsoncxx::v_noabi::stdx::optional< v_noabi::result::update > update_one(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, v_noabi::options::update const &options={})
Updates a single document matching the provided filter in this collection.
v_noabi::cursor list_indexes(v_noabi::client_session const &session) const
Returns a list of the indexes currently on this collection.
v_noabi::index_view indexes()
Gets an index_view to the collection.
bsoncxx::v_noabi::stdx::string_view name() const
Returns the name of this collection.
std::int64_t estimated_document_count(v_noabi::options::estimated_document_count const &options={})
Returns an estimate of the number of documents in the collection.
v_noabi::cursor aggregate(v_noabi::pipeline const &pipeline, v_noabi::options::aggregate const &options={})
Runs an aggregation framework pipeline against this collection.
v_noabi::change_stream watch(v_noabi::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< v_noabi::result::delete_result > delete_many(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::delete_options const &options={})
Deletes all matching documents from the collection.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::bulk_write > write(v_noabi::client_session const &session, v_noabi::model::write const &write, v_noabi::options::bulk_write const &options={})
Sends a write to the server as a bulk write operation.
Definition collection.hpp:309
bsoncxx::v_noabi::stdx::optional< v_noabi::result::insert_one > insert_one(bsoncxx::v_noabi::document::view_or_value document, v_noabi::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< v_noabi::result::insert_many > insert_many(container_type const &container, v_noabi::options::insert const &options={})
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1192
bsoncxx::v_noabi::stdx::optional< v_noabi::result::delete_result > delete_one(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::delete_options const &options={})
Deletes a single matching document from the collection.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::value > find_one(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::find const &options={})
Finds a single document in this collection that match the provided filter.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::insert_many > insert_many(document_view_iterator_type begin, document_view_iterator_type end, v_noabi::options::insert const &options={})
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1251
v_noabi::read_preference read_preference() const
Gets the read_preference for the collection.
v_noabi::bulk_write create_bulk_write(v_noabi::options::bulk_write const &options={})
Creates a new bulk operation to be executed against this collection. The lifetime of the bulk_write i...
std::int64_t count_documents(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::count const &options={})
Counts the number of documents matching the provided filter.
v_noabi::cursor distinct(bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::distinct const &options={})
Finds the distinct values for a specified field across the collection.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::insert_many > insert_many(v_noabi::client_session const &session, document_view_iterator_type begin, document_view_iterator_type end, v_noabi::options::insert const &options={})
Inserts multiple documents into the collection. If any of the documents are missing identifiers the d...
Definition collection.hpp:1280
v_noabi::read_concern read_concern() const
Gets the read_concern for the collection.
void rename(bsoncxx::v_noabi::string::view_or_value new_name, bool drop_target_before_rename=false, bsoncxx::v_noabi::stdx::optional< v_noabi::write_concern > const &write_concern={})
Rename this collection.
collection() noexcept
Default constructs a collection object. The collection is equivalent to the state of a moved from col...
Definition collection.hpp:123
collection(collection &&other) noexcept=default
Move constructs a collection.
void read_preference(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< bsoncxx::v_noabi::document::value > find_one_and_delete(bsoncxx::v_noabi::document::view_or_value filter, v_noabi::options::find_one_and_delete const &options={})
Finds a single document matching the filter, deletes it, and returns the original.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::update > update_many(bsoncxx::v_noabi::document::view_or_value filter, bsoncxx::v_noabi::document::view_or_value update, v_noabi::options::update const &options={})
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, v_noabi::options::find_one_and_replace const &options={})
Finds a single document matching the filter, replaces it, and returns either the original or the repl...
bsoncxx::v_noabi::stdx::optional< v_noabi::result::bulk_write > bulk_write(v_noabi::client_session const &session, container_type const &writes, v_noabi::options::bulk_write const &options={})
Sends a container of writes to the server as a bulk write operation.
Definition collection.hpp:370
v_noabi::write_concern write_concern() const
Gets the write_concern for the collection.
bsoncxx::v_noabi::stdx::optional< v_noabi::result::bulk_write > write(v_noabi::model::write const &write, v_noabi::options::bulk_write const &options={})
Sends a write to the server as a bulk write operation.
Definition collection.hpp:280
collection & operator=(collection &&other) noexcept=default
Move assigns a 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, v_noabi::options::find_one_and_update const &options={})
Finds a single document matching the filter, updates it, and returns either the original or the newly...
A cursor over the documents returned by a query to a MongoDB server.
Definition cursor.hpp:50
A MongoDB index.
Definition index_view.hpp:50
bsoncxx::v_noabi::stdx::optional< std::string > create_one(bsoncxx::v_noabi::document::view_or_value const &keys, bsoncxx::v_noabi::document::view_or_value const &index_options={}, v_noabi::options::index_view const &options={})
Creates an index. A convenience method that calls create_many.
Definition index_view.hpp:122
A single write operation for use with mongocxx::v_noabi::bulk_write.
Definition write.hpp:45
Used by mongocxx::v_noabi::collection.
Definition bulk_write.hpp:45
Used by change streams.
Definition change_stream.hpp:52
Used by MongoDB index view operations.
Definition index_view.hpp:45
Used by mongocxx::v_noabi::collection.
Definition insert.hpp:44
A MongoDB aggregation pipeline.
Definition pipeline.hpp:45
Controls the consistency and isolation properties of data read from replica sets and sharded clusters...
Definition read_concern.hpp:54
Describes how MongoDB clients route read operations to the members of a replica set or sharded cluste...
Definition read_preference.hpp:59
A MongoDB Atlas Search Index.
Definition search_index_view.hpp:48
The level of acknowledgment requested for write operations to a MongoDB server.
Definition write_concern.hpp:54
Provides concatenators for use with "streaming" BSON builder syntax.
Provides mongocxx::v_noabi::options::count.
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.
Declares entities used with "basic" BSON builder syntax.
v_noabi::document::value make_document(Args &&... args)
Creates a document from a list of key-value pairs.
Definition document.hpp:118
std::tuple< T &&, U && > kvp(T &&t, U &&u)
Constructs a key-value pair from a string key and a BSON value.
Definition kvp.hpp:31
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
Declares C++17 standard library polyfills.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities whose ABI stability is guaranteed for documented symbols.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v_noabi::options::delete_options.
Provides mongocxx::v_noabi::options::index_view.
Provides mongocxx::v_noabi::options::update.
Provides mongocxx::v_noabi::options::replace.
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::v1::collection.
Provides bsoncxx::v_noabi::document::value.
Provides bsoncxx::v_noabi::oid.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.
Declares mongocxx::v_noabi::bulk_write.
Provides mongocxx::v_noabi::bulk_write.
Provides mongocxx::v_noabi::change_stream.
Declares mongocxx::v_noabi::client_encryption.
Provides mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
Provides mongocxx::v_noabi::cursor.
Declares mongocxx::v_noabi::database.
Provides mongocxx::v_noabi::options::bulk_write.
Provides mongocxx::v_noabi::options::change_stream.
Provides mongocxx::v_noabi::pipeline.
Provides mongocxx::v_noabi::read_concern.
Provides mongocxx::v_noabi::read_preference.
Provides mongocxx::v_noabi::result::bulk_write.
Provides mongocxx::v_noabi::write_concern.
Provides mongocxx::v_noabi::model::write.