Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6168b71
cpx: cxx-abi-v1-instance
eramongodb Oct 9, 2025
dc60649
CXX-3236 add mongocxx v1 declarations
eramongodb Oct 9, 2025
60d1a13
Revert stray update to comment in macros.hpp
eramongodb Oct 9, 2025
911e8da
Merge remote-tracking branch 'upstream/master' into cxx-3236
eramongodb Oct 9, 2025
3fe2eec
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Oct 10, 2025
65ee4ff
Fix ownership of `v1::collection::find_one_and_*` return values
eramongodb Oct 10, 2025
a41e3a0
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Oct 21, 2025
11c7cec
Add missing documentation for "v" field
eramongodb Oct 21, 2025
92711e1
Fix typos
eramongodb Oct 21, 2025
4a53140
Return round_trip_time as Optional<Int64>
eramongodb Oct 21, 2025
e9060f1
Define `awaited()` in terms of "streaming" vs. "polling" protocols
eramongodb Oct 21, 2025
e5d7a8e
Remove `close()` note from `upload_from_stream()` docs
eramongodb Oct 21, 2025
c24b0d8
Fix parameter name
eramongodb Oct 21, 2025
f8c2489
Remove NTBS overloads in favor of string_view only
eramongodb Oct 21, 2025
b6971a0
Avoid more string allocations
eramongodb Oct 21, 2025
4520840
Migrate deprecated `.hedge()` to v1::read_preference
eramongodb Oct 21, 2025
a047d5c
Fix v1::indexes assignment return type
eramongodb Oct 21, 2025
bb4056c
Replace `std::unique_ptr<T>` with `void*`
eramongodb Oct 21, 2025
5fe9079
Fix IWYU missing headers
eramongodb Oct 21, 2025
554949c
Fix documentation: empty wtag is allowed
eramongodb Oct 21, 2025
8c0f4a7
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Oct 23, 2025
ae0530e
Use `key_function()` instead of out-of-line default dtor
eramongodb Oct 23, 2025
c080b1b
Silence C4251 and C4275 for v1::server_error
eramongodb Oct 23, 2025
bac39f2
IWYU
eramongodb Oct 23, 2025
9b4e7f5
Formatting
eramongodb Oct 23, 2025
4e31b92
Merge remote-tracking branch 'upstream/master' into cxx-3236
eramongodb Oct 23, 2025
a1580b4
Address Doxygen 1.15.0 unresolved reference warnings
eramongodb Oct 24, 2025
f755f39
Revert to using dtor as key function for v1::server_error
eramongodb Oct 24, 2025
b56c9ad
Fix return type for `v1::client_encryption::key_vault_client()`
eramongodb Oct 28, 2025
40793f3
Rename parameter: pipe -> pipeline
eramongodb Oct 28, 2025
78b395e
Fix, tweak, and improve documentation per PR feedback
eramongodb Oct 28, 2025
ba94f7e
Merge remote-tracking branch 'upstream/master' into cxx-3236
eramongodb Oct 28, 2025
8e8c794
Fix missing export macro
eramongodb Oct 29, 2025
fab9692
Support using sentinels in range-based overload templates
eramongodb Oct 29, 2025
19f7201
Avoid documenting internal representation details for bulk write results
eramongodb Oct 29, 2025
1149597
Merge remote-tracking branch 'upstream/master' into HEAD
eramongodb Oct 30, 2025
5ade46e
Move "errorLabels" support from v1::server_error to v1::exception
eramongodb Oct 30, 2025
ec483ea
Make stateful exception classes nothrow copy constructible
eramongodb Oct 30, 2025
803d3a8
IWYU: make v1::exception transitively provided by v1::server_error
eramongodb Oct 31, 2025
6ec6465
IWYU: make v1::client transitively provided by v1::pool
eramongodb Oct 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 187 additions & 1 deletion src/mongocxx/include/mongocxx/v1/aggregate_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,204 @@

#include <mongocxx/v1/detail/prelude.hpp>

#include <bsoncxx/v1/document/value-fwd.hpp>
#include <bsoncxx/v1/document/view-fwd.hpp>
#include <bsoncxx/v1/types/value-fwd.hpp>
#include <bsoncxx/v1/types/view-fwd.hpp>

#include <mongocxx/v1/hint-fwd.hpp>
#include <mongocxx/v1/read_concern-fwd.hpp>
#include <mongocxx/v1/read_preference-fwd.hpp>
#include <mongocxx/v1/write_concern-fwd.hpp>

#include <bsoncxx/v1/stdx/optional.hpp>

#include <mongocxx/v1/config/export.hpp>

#include <chrono>
#include <cstdint>

namespace mongocxx {
namespace v1 {

///
/// Options for an "aggregate" command.
///
/// Supported fields include:
/// - `allow_disk_use` ("allowDiskUse")
/// - `batch_size` ("batchSize")
/// - `bypass_document_validation` ("bypassDocumentValidation")
/// - `collation`
/// - `comment`
/// - `hint`
/// - `let`
/// - `max_time` ("maxTimeMS")
/// - `read_concern` ("readConcern")
/// - `read_preference` ("readPreference")
/// - `write_concern` ("writeConcern")
///
/// @see
/// - [`aggregate` (database command) (MongoDB Manual)](https://www.mongodb.com/docs/manual/aggregation/)
///
/// @attention This feature is experimental! It is not ready for use!
///
class aggregate_options {};
class aggregate_options {
private:
class impl;
void* _impl;

public:
///
/// Destroy this object.
///
/// @warning Invalidates all associated views.
///
MONGOCXX_ABI_EXPORT_CDECL() ~aggregate_options();

///
/// Move constructor.
///
/// @par Postconditions:
/// - `other` is in an assign-or-destroy-only state.
///
MONGOCXX_ABI_EXPORT_CDECL() aggregate_options(aggregate_options&& other) noexcept;

///
/// Move assignment.
///
/// @par Postconditions:
/// - `other` is in an assign-or-destroy-only state.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) operator=(aggregate_options&& other) noexcept;

///
/// Copy construction.
///
MONGOCXX_ABI_EXPORT_CDECL() aggregate_options(aggregate_options const& other);

///
/// Copy assignment.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) operator=(aggregate_options const& other);

///
/// Default initialization.
///
/// @par Postconditions:
/// - All supported fields are "unset" or zero-initialized.
///
MONGOCXX_ABI_EXPORT_CDECL() aggregate_options();

///
/// Set the "allowDiskUse" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) allow_disk_use(bool allow_disk_use);

///
/// Return the current "allowDiskUse" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) allow_disk_use() const;

///
/// Set the "batchSize" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) batch_size(std::int32_t batch_size);

///
/// Return the current "batchSize" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int32_t>) batch_size() const;

///
/// Set the "collation" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) collation(bsoncxx::v1::document::value collation);

///
/// Return the current "collation" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) collation() const;

///
/// Set the "let" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) let(bsoncxx::v1::document::value let);

///
/// Return the current "let" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::document::view>) let() const;

///
/// Set the "maxTimeMS" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) max_time(std::chrono::milliseconds max_time);

///
/// Return the current "maxTimeMS" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::chrono::milliseconds>) max_time() const;

///
/// Set the "readPreference" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) read_preference(v1::read_preference rp);

///
/// Return the current "readPreference" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::read_preference>) read_preference() const;

///
/// Set the "bypassDocumentValidation" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) bypass_document_validation(bool bypass_document_validation);

///
/// Return the current "bypassDocumentValidation" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bool>) bypass_document_validation() const;

///
/// Set the "hint" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) hint(v1::hint index_hint);

///
/// Return the current "hint" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::hint>) hint() const;

///
/// Set the "writeConcern" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) write_concern(v1::write_concern write_concern);

///
/// Return the current "writeConcern" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::write_concern>) write_concern() const;

///
/// Set the "readConcern" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) read_concern(v1::read_concern read_concern);

///
/// Return the current "readConcern" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::read_concern>) read_concern() const;

///
/// Set the "comment" field.
///
MONGOCXX_ABI_EXPORT_CDECL(aggregate_options&) comment(bsoncxx::v1::types::value comment);

///
/// Return the current "comment" field.
///
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) comment() const;
};

} // namespace v1
} // namespace mongocxx
Expand Down
Loading