6#include <userver/storages/mongo/bulk_ops.hpp>
7#include <userver/storages/mongo/options.hpp>
8#include <userver/utils/fast_pimpl.hpp>
10USERVER_NAMESPACE_BEGIN
12namespace storages::mongo::impl::cdriver {
13class CDriverCollectionImpl;
21 enum class Mode { kOrdered, kUnordered };
26 Bulk(
const Bulk&) =
delete;
27 Bulk(
Bulk&&)
noexcept;
28 Bulk& operator=(
const Bulk&) =
delete;
38 template <
typename... Options>
43 template <
typename... Options>
45 formats::
bson::
Document replacement, Options&&... options);
49 template <
typename... Options>
55 template <
typename... Options>
60 template <
typename... Options>
64 template <
typename... Options>
76 friend class storages::mongo::impl::cdriver::CDriverCollectionImpl;
79 static constexpr size_t kSize = 56;
80 static constexpr size_t kAlignment = 8;
82 utils::FastPimpl<Impl, kSize, kAlignment,
false> impl_;
85template <
typename... Options>
88 (insert_subop.SetOption(std::forward<Options>(options)), ...);
92template <
typename... Options>
95 Options&&... options) {
97 std::move(replacement));
98 (replace_subop.SetOption(std::forward<Options>(options)), ...);
99 Append(replace_subop);
102template <
typename... Options>
106 std::move(selector), std::move(update));
107 (update_subop.SetOption(std::forward<Options>(options)), ...);
108 Append(update_subop);
111template <
typename... Options>
115 std::move(selector), std::move(update));
116 (update_subop.SetOption(std::forward<Options>(options)), ...);
117 Append(update_subop);
120template <
typename... Options>
123 std::move(selector));
124 (delete_subop.SetOption(std::forward<Options>(options)), ...);
125 Append(delete_subop);
128template <
typename... Options>
131 std::move(selector));
132 (delete_subop.SetOption(std::forward<Options>(options)), ...);
133 Append(delete_subop);