Loading...
Searching...
No Matches
bulk_write.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/bulk_write-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/bulk_write.hpp> // IWYU pragma: export
#include <utility>
#include <mongocxx/collection-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <bsoncxx/stdx/optional.hpp>
#include <mongocxx/client_session.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <mongocxx/model/write.hpp>
#include <mongocxx/options/bulk_write.hpp>
#include <mongocxx/result/bulk_write.hpp>
#include <mongocxx/config/prelude.hpp>
namespace mongocxx {
namespace v_noabi {
class bulk_write {
private:
v1::bulk_write _bulk;
public:
bulk_write(bulk_write&&) noexcept = default;
bulk_write& operator=(bulk_write&&) noexcept = default;
bulk_write(bulk_write const& other) = delete;
bulk_write& operator=(bulk_write const& other) = delete;
~bulk_write() = default;
/* explicit(false) */ bulk_write(v1::bulk_write bulk) : _bulk{std::move(bulk)} {}
explicit operator v1::bulk_write() && {
return std::move(_bulk);
}
explicit operator v1::bulk_write() const& = delete;
bool empty() const noexcept {
return _bulk.empty();
}
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(bulk_write&) append(v_noabi::model::write const& operation);
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(bsoncxx::v_noabi::stdx::optional<result::bulk_write>) execute() const;
class internal;
};
inline v_noabi::bulk_write from_v1(v1::bulk_write v) {
return {std::move(v)};
}
inline v1::bulk_write to_v1(v_noabi::bulk_write v) {
return v1::bulk_write{std::move(v)};
}
} // namespace v_noabi
} // namespace mongocxx
#include <mongocxx/config/postlude.hpp>
bsoncxx::v1::stdx::optional
A polyfill for std::optional<T>.
Definition optional.hpp:799
mongocxx::bulk_write::bulk_write
bulk_write(bulk_write &&) noexcept=default
Move constructs a bulk write operation.
mongocxx::v1::bulk_write
A list of bulk write operations.
Definition bulk_write.hpp:53
mongocxx::v_noabi::bulk_write
A batch of write operations that can be sent to the server as a group.
Definition bulk_write.hpp:54
mongocxx::v_noabi::bulk_write::bulk_write
bulk_write(bulk_write &&) noexcept=default
Move constructs a bulk write operation.
mongocxx::v_noabi::bulk_write::empty
bool empty() const noexcept
Checks if a bulk write operation is empty.
Definition bulk_write.hpp:109
mongocxx::v_noabi::bulk_write::execute
bsoncxx::v_noabi::stdx::optional< result::bulk_write > execute() const
Executes a bulk write.
mongocxx::v_noabi::bulk_write::append
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...
mongocxx::v_noabi::model::write
A single write operation for use with mongocxx::v_noabi::bulk_write.
Definition write.hpp:45
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE
#define MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(...)
Equivalent to MONGOCXX_ABI_EXPORT_UNSTABLE with MONGOCXX_ABI_CDECL.
Definition config.hpp:28
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
mongocxx::v_noabi::to_v1
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
mongocxx::v_noabi::from_v1
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
bulk_write.hpp
Provides entities related to write operations.
optional.hpp
Provides std::optional-related polyfills for library API usage.
bulk_write-fwd.hpp
Declares mongocxx::v_noabi::bulk_write.
client_session.hpp
Provides mongocxx::v_noabi::client_session.
collection-fwd.hpp
Declares mongocxx::v_noabi::collection.
bulk_write.hpp
Provides mongocxx::v_noabi::options::bulk_write.
bulk_write.hpp
Provides mongocxx::v_noabi::result::bulk_write.
write.hpp
Provides mongocxx::v_noabi::model::write.