MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
bulk_write.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/result/bulk_write-fwd.hpp> // IWYU pragma: export
18
19//
20
21#include <mongocxx/v1/bulk_write.hpp> // IWYU pragma: export
22
23#include <cstddef>
24#include <cstdint>
25#include <map>
26#include <utility>
27#include <vector> // IWYU pragma: keep: backward compatibility, to be removed.
28
31#include <bsoncxx/document/view.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
32#include <bsoncxx/types.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
33
35
36namespace mongocxx {
37namespace v_noabi {
38namespace result {
39
44 private:
46
47 public:
48 using id_map = std::map<std::size_t, bsoncxx::v_noabi::document::element>;
49
53 explicit MONGOCXX_ABI_EXPORT_CDECL() bulk_write(bsoncxx::v_noabi::document::value raw_response);
54
58 /* explicit(false) */ bulk_write(v1::bulk_write::result result) : _result{std::move(result)} {}
59
68 explicit operator v1::bulk_write::result() && {
69 return std::move(_result);
70 }
71
75 explicit operator v1::bulk_write::result() const& {
76 return _result;
77 }
78
85
92
99
106
113
121
122 friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(bulk_write const& lhs, bulk_write const& rhs);
123
124 friend bool operator!=(bulk_write const& lhs, bulk_write const& rhs) {
125 return !(lhs == rhs);
126 }
127};
128
129} // namespace result
130} // namespace v_noabi
131} // namespace mongocxx
132
133namespace mongocxx {
134namespace v_noabi {
135
140 return {std::move(v)};
141}
142
149
150} // namespace v_noabi
151} // namespace mongocxx
152
154
bulk_write(bsoncxx::v_noabi::document::value raw_response)
The result of a write operation.
Definition bulk_write.hpp:1032
The result of a MongoDB bulk write operation.
Definition bulk_write.hpp:43
std::int32_t modified_count() const
Gets the number of documents that were modified during this operation.
std::int32_t upserted_count() const
Gets the number of documents that were upserted during this operation.
std::int32_t inserted_count() const
Gets the number of documents that were inserted during this operation.
operator v1::bulk_write::result() &&
Convert to the mongocxx::v1 equivalent.
Definition bulk_write.hpp:68
std::int32_t matched_count() const
Gets the number of documents that were matched during this operation.
std::int32_t deleted_count() const
Gets the number of documents that were deleted during this operation.
id_map upserted_ids() const
Gets the ids of the upserted documents.
bulk_write(bsoncxx::v_noabi::document::value raw_response)
Provides bsoncxx::v_noabi::document::element.
#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.
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 the result of 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 entities used to represent BSON types.
Provides entities related to write operations.
Provides bsoncxx::v_noabi::document::value.
Provides bsoncxx::v_noabi::document::view.
Declares mongocxx::v_noabi::result::bulk_write.