MongoDB C++ Driver current
Loading...
Searching...
No Matches
bulk_write.hpp
1// Copyright 2014-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/client_session.hpp>
18#include <mongocxx/model/write.hpp>
19#include <mongocxx/options/bulk_write.hpp>
20#include <mongocxx/result/bulk_write.hpp>
21
22#include <mongocxx/config/prelude.hpp>
23
24namespace mongocxx {
25inline namespace v_noabi {
26class collection;
27
42class MONGOCXX_API bulk_write {
43 public:
48
52 bulk_write& operator=(bulk_write&&) noexcept;
53
58
81 bulk_write& append(const model::write& operation);
82
92 stdx::optional<result::bulk_write> execute() const;
93
94 private:
95 friend class collection;
96
97 class MONGOCXX_PRIVATE impl;
98
99 MONGOCXX_PRIVATE bulk_write(const collection& coll,
100 const options::bulk_write& options,
101 const client_session* session = nullptr);
102
103 bool _created_from_collection;
104 std::unique_ptr<impl> _impl;
105};
106
107} // namespace v_noabi
108} // namespace mongocxx
109
110#include <mongocxx/config/postlude.hpp>
Class representing a batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:42
bulk_write(bulk_write &&) noexcept
Move constructs a bulk write operation.
Use a session for a sequence of operations, optionally with either causal consistency or snapshots.
Definition client_session.hpp:40
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:85
The top-level namespace for mongocxx library entities.
Definition bulk_write.hpp:24