MongoDB C++ Driver current
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
138 MONGOCXX_ABI_EXPORT_CDECL(aggregate&) let(bsoncxx::v_noabi::document::view_or_value let);
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
201 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_preference> const&)
203
215
224 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&)
226
244
253 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::hint> const&)
254 hint() const;
255
272
282 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::write_concern> const&)
284
299
309 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<mongocxx::v_noabi::read_concern> const&)
311
325 comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment);
326
336 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<
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
The index to "hint" or force a MongoDB server to use when performing a query.
Definition hint.hpp:35
Used by MongoDB aggregation operations.
Definition aggregate.hpp:43
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > const & max_time() const
The current max_time setting.
bsoncxx::v_noabi::stdx::optional< bool > const & allow_disk_use() const
Retrieves the current allow_disk_use setting.
bsoncxx::v_noabi::stdx::optional< std::int32_t > const & batch_size() const
The current batch size setting.
aggregate & batch_size(std::int32_t batch_size)
Sets the number of documents to return per batch.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & let() const
Retrieves the current variable mapping for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & comment() const
Gets the current comment.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & collation() const
Retrieves the current collation for this operation.
bsoncxx::v_noabi::stdx::optional< bool > const & bypass_document_validation() const
The current bypass_document_validation setting.
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...
Controls the consistency and isolation properties of data read from replica sets and sharded clusters...
Definition read_concern.hpp:48
Describes how MongoDB clients route read operations to the members of a replica set or sharded cluste...
Definition read_preference.hpp:49
The level of acknowledgment requested for write operations to a MongoDB server.
Definition write_concern.hpp:48
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.
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.