MongoDB C++ Driver mongocxx-3.11.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
19
24
26
27namespace mongocxx {
28namespace v_noabi {
29
46 public:
51
56
61
67 MONGOCXX_ABI_EXPORT_CDECL(bool) empty() const noexcept;
68
91 MONGOCXX_ABI_EXPORT_CDECL(bulk_write&) append(const model::write& operation);
92
103 MONGOCXX_ABI_EXPORT_CDECL(stdx::optional<result::bulk_write>) execute() const;
104
105 private:
106 friend ::mongocxx::v_noabi::collection;
107
108 class impl;
109
110 bulk_write(const collection& coll,
111 const options::bulk_write& options,
112 const client_session* session = nullptr);
113
114 bool _created_from_collection;
115 std::unique_ptr<impl> _impl;
116};
117
118} // namespace v_noabi
119} // namespace mongocxx
120
121#include <mongocxx/config/postlude.hpp>
122
Declares mongocxx::v_noabi::bulk_write.
Class representing a batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:45
bool empty() const noexcept
Checks if a bulk write operation is empty.
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...
stdx::optional< result::bulk_write > execute() const
Executes a bulk write.
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
Provides mongocxx::v_noabi::client_session.
Declares mongocxx::v_noabi::collection.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
The mongocxx macro guard prelude header.
The top-level namespace within which all mongocxx library entities are declared.
The top-level namespace reserved for the C++ standard library.
Provides mongocxx::v_noabi::options::bulk_write.
Provides mongocxx::v_noabi::result::bulk_write.
Provides mongocxx::v_noabi::model::write.