MongoDB C++ Driver 4.1.0
Loading...
Searching...
No Matches
aggregate.hpp
Go to the documentation of this file.
1// Copyright 2009-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 <chrono>
18#include <cstdint>
19
23
28
29#include <mongocxx/hint.hpp>
33
35
36namespace mongocxx {
37namespace v_noabi {
38namespace options {
39
43class aggregate {
44 public:
60
70
85
95 batch_size() const;
96
111 collation(bsoncxx::v_noabi::document::view_or_value collation);
112
122 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
123 collation() const;
124
139
149 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
150 let() const;
151
166
176 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::chrono::milliseconds> const&)
177 max_time() const;
178
192
203
215
224 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&)
226
244
254 hint() const;
255
272
284
299
311
325 comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment);
326
337 bsoncxx::v_noabi::types::bson_value::view_or_value> const&)
338 comment() const;
339
340 private:
341 friend ::mongocxx::v_noabi::collection;
342 friend ::mongocxx::v_noabi::database;
343
344 void append(bsoncxx::v_noabi::builder::basic::document& builder) const;
345
346 bsoncxx::v_noabi::stdx::optional<bool> _allow_disk_use;
347 bsoncxx::v_noabi::stdx::optional<std::int32_t> _batch_size;
348 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _collation;
349 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _let;
350 bsoncxx::v_noabi::stdx::optional<std::chrono::milliseconds> _max_time;
351 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_preference> _read_preference;
352 bsoncxx::v_noabi::stdx::optional<bool> _bypass_document_validation;
353 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::hint> _hint;
354 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern> _write_concern;
355 bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_concern> _read_concern;
356 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _comment;
357};
358
359} // namespace options
360} // namespace v_noabi
361} // namespace mongocxx
362
363#include <mongocxx/config/postlude.hpp>
364
Declares mongocxx::v_noabi::options::aggregate.
Provides bsoncxx::v_noabi::builder::basic::document.
A polyfill for std::optional<T>.
Definition optional.hpp:800
A MongoDB collection.
Definition collection.hpp:87
A MongoDB database.
Definition database.hpp:46
Used by MongoDB aggregation operations.
Definition aggregate.hpp:43
aggregate & let(bsoncxx::v_noabi::document::view_or_value let)
Sets the variable mapping for this operation.
aggregate & bypass_document_validation(bool bypass_document_validation)
Sets whether the $out stage should bypass document validation.
bsoncxx::v_noabi::stdx::optional< bool > const & allow_disk_use() const
Retrieves the current allow_disk_use setting.
aggregate & max_time(std::chrono::milliseconds max_time)
Sets the maximum amount of time for this operation to run server-side in milliseconds.
aggregate & batch_size(std::int32_t batch_size)
Sets the number of documents to return per batch.
aggregate & hint(mongocxx::v_noabi::hint index_hint)
Sets the index to use for this operation.
aggregate & comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment)
Sets the comment to use for this operation.
aggregate & collation(bsoncxx::v_noabi::document::view_or_value collation)
Sets the collation for this operation.
aggregate & read_preference(mongocxx::v_noabi::read_preference rp)
Sets the read_preference for this operation.
aggregate & write_concern(mongocxx::v_noabi::write_concern write_concern)
Sets the write concern to use for this operation. Only has an effect if $out is a part of the pipelin...
aggregate & allow_disk_use(bool allow_disk_use)
Enables writing to temporary files. When set to true, aggregation stages can write data to the _tmp s...
aggregate & read_concern(mongocxx::v_noabi::read_concern read_concern)
Sets the read concern to use for this operation.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Provides bsoncxx::v_noabi::document::view_or_value.
Provides mongocxx::v_noabi::hint.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v_noabi::read_concern.
Provides mongocxx::v_noabi::read_preference.
Provides bsoncxx::v_noabi::types::bson_value::view_or_value.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::write_concern.