|
20 | 20 |
|
21 | 21 | #include <mongocxx/v1/detail/prelude.hpp> |
22 | 22 |
|
| 23 | +#include <bsoncxx/v1/document/value-fwd.hpp> |
| 24 | +#include <bsoncxx/v1/document/view-fwd.hpp> |
| 25 | +#include <bsoncxx/v1/types/value-fwd.hpp> |
| 26 | +#include <bsoncxx/v1/types/view-fwd.hpp> |
| 27 | + |
| 28 | +#include <mongocxx/v1/hint-fwd.hpp> |
| 29 | +#include <mongocxx/v1/read_concern-fwd.hpp> |
| 30 | +#include <mongocxx/v1/read_preference-fwd.hpp> |
| 31 | +#include <mongocxx/v1/write_concern-fwd.hpp> |
| 32 | + |
| 33 | +#include <bsoncxx/v1/stdx/optional.hpp> |
| 34 | + |
| 35 | +#include <mongocxx/v1/config/export.hpp> |
| 36 | + |
| 37 | +#include <chrono> |
| 38 | +#include <cstdint> |
| 39 | + |
23 | 40 | namespace mongocxx { |
24 | 41 | namespace v1 { |
25 | 42 |
|
26 | 43 | /// |
27 | 44 | /// Options for an "aggregate" command. |
28 | 45 | /// |
| 46 | +/// Supported fields include: |
| 47 | +/// - `allow_disk_use` ("allowDiskUse") |
| 48 | +/// - `batch_size` ("batchSize") |
| 49 | +/// - `bypass_document_validation` ("bypassDocumentValidation") |
| 50 | +/// - `collation` |
| 51 | +/// - `comment` |
| 52 | +/// - `hint` |
| 53 | +/// - `let` |
| 54 | +/// - `max_time` ("maxTimeMS") |
| 55 | +/// - `read_concern` ("readConcern") |
| 56 | +/// - `read_preference` ("readPreference") |
| 57 | +/// - `write_concern` ("writeConcern") |
| 58 | +/// |
29 | 59 | /// @see |
30 | 60 | /// - [`aggregate` (database command) (MongoDB Manual)](https://www.mongodb.com/docs/manual/aggregation/) |
31 | 61 | /// |
32 | 62 | /// @attention This feature is experimental! It is not ready for use! |
33 | 63 | /// |
34 | | -class aggregate_options {}; |
| 64 | +class aggregate_options { |
| 65 | + private: |
| 66 | + class impl; |
| 67 | + void* _impl; |
| 68 | + |
| 69 | + public: |
| 70 | + /// |
| 71 | + /// Destroy this object. |
| 72 | + /// |
| 73 | + /// @warning Invalidates all associated views. |
| 74 | + /// |
| 75 | + MONGOCXX_ABI_EXPORT_CDECL() ~aggregate_options(); |
| 76 | + |
| 77 | + /// |
| 78 | + /// Move constructor. |
| 79 | + /// |
| 80 | + /// @par Postconditions: |
| 81 | + /// - `other` is in an assign-or-destroy-only state. |
| 82 | + /// |
| 83 | + MONGOCXX_ABI_EXPORT_CDECL() aggregate_options(aggregate_options&& other) noexcept; |
| 84 | + |
| 85 | + /// |
| 86 | + /// Move assignment. |
| 87 | + /// |
| 88 | + /// @par Postconditions: |
| 89 | + /// - `other` is in an assign-or-destroy-only state. |
| 90 | + /// |
| 91 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) operator=(aggregate_options&& other) noexcept; |
| 92 | + |
| 93 | + /// |
| 94 | + /// Copy construction. |
| 95 | + /// |
| 96 | + MONGOCXX_ABI_EXPORT_CDECL() aggregate_options(aggregate_options const& other); |
| 97 | + |
| 98 | + /// |
| 99 | + /// Copy assignment. |
| 100 | + /// |
| 101 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) operator=(aggregate_options const& other); |
| 102 | + |
| 103 | + /// |
| 104 | + /// Default initialization. |
| 105 | + /// |
| 106 | + /// @par Postconditions: |
| 107 | + /// - All supported fields are "unset" or zero-initialized. |
| 108 | + /// |
| 109 | + MONGOCXX_ABI_EXPORT_CDECL() aggregate_options(); |
| 110 | + |
| 111 | + /// |
| 112 | + /// Set the "allowDiskUse" field. |
| 113 | + /// |
| 114 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) allow_disk_use(bool allow_disk_use); |
| 115 | + |
| 116 | + /// |
| 117 | + /// Return the current "allowDiskUse" field. |
| 118 | + /// |
| 119 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) allow_disk_use() const; |
| 120 | + |
| 121 | + /// |
| 122 | + /// Set the "batchSize" field. |
| 123 | + /// |
| 124 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) batch_size(std::int32_t batch_size); |
| 125 | + |
| 126 | + /// |
| 127 | + /// Return the current "batchSize" field. |
| 128 | + /// |
| 129 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int32_t>) batch_size() const; |
| 130 | + |
| 131 | + /// |
| 132 | + /// Set the "collation" field. |
| 133 | + /// |
| 134 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) collation(bsoncxx::v1::document::value collation); |
| 135 | + |
| 136 | + /// |
| 137 | + /// Return the current "collation" field. |
| 138 | + /// |
| 139 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) collation() const; |
| 140 | + |
| 141 | + /// |
| 142 | + /// Set the "let" field. |
| 143 | + /// |
| 144 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) let(bsoncxx::v1::document::value let); |
| 145 | + |
| 146 | + /// |
| 147 | + /// Return the current "let" field. |
| 148 | + /// |
| 149 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) let() const; |
| 150 | + |
| 151 | + /// |
| 152 | + /// Set the "maxTimeMS" field. |
| 153 | + /// |
| 154 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) max_time(std::chrono::milliseconds max_time); |
| 155 | + |
| 156 | + /// |
| 157 | + /// Return the current "maxTimeMS" field. |
| 158 | + /// |
| 159 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const; |
| 160 | + |
| 161 | + /// |
| 162 | + /// Set the "readPreference" field. |
| 163 | + /// |
| 164 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) read_preference(v1::read_preference rp); |
| 165 | + |
| 166 | + /// |
| 167 | + /// Return the current "readPreference" field. |
| 168 | + /// |
| 169 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::read_preference>) read_preference() const; |
| 170 | + |
| 171 | + /// |
| 172 | + /// Set the "bypassDocumentValidation" field. |
| 173 | + /// |
| 174 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) bypass_document_validation(bool bypass_document_validation); |
| 175 | + |
| 176 | + /// |
| 177 | + /// Return the current "bypassDocumentValidation" field. |
| 178 | + /// |
| 179 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) bypass_document_validation() const; |
| 180 | + |
| 181 | + /// |
| 182 | + /// Set the "hint" field. |
| 183 | + /// |
| 184 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) hint(v1::hint index_hint); |
| 185 | + |
| 186 | + /// |
| 187 | + /// Return the current "hint" field. |
| 188 | + /// |
| 189 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::hint>) hint() const; |
| 190 | + |
| 191 | + /// |
| 192 | + /// Set the "writeConcern" field. |
| 193 | + /// |
| 194 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) write_concern(v1::write_concern write_concern); |
| 195 | + |
| 196 | + /// |
| 197 | + /// Return the current "writeConcern" field. |
| 198 | + /// |
| 199 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const; |
| 200 | + |
| 201 | + /// |
| 202 | + /// Set the "readConcern" field. |
| 203 | + /// |
| 204 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) read_concern(v1::read_concern read_concern); |
| 205 | + |
| 206 | + /// |
| 207 | + /// Return the current "readConcern" field. |
| 208 | + /// |
| 209 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::read_concern>) read_concern() const; |
| 210 | + |
| 211 | + /// |
| 212 | + /// Set the "comment" field. |
| 213 | + /// |
| 214 | + MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) comment(bsoncxx::v1::types::value comment); |
| 215 | + |
| 216 | + /// |
| 217 | + /// Return the current "comment" field. |
| 218 | + /// |
| 219 | + MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const; |
| 220 | +}; |
35 | 221 |
|
36 | 222 | } // namespace v1 |
37 | 223 | } // namespace mongocxx |
|
0 commit comments