MongoDB C++ Driver  mongocxx-3.3.2
All Classes Namespaces Functions Enumerations Enumerator Friends Pages
change_stream.hpp
1 // Copyright 2018-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 
19 #include <bsoncxx/document/view_or_value.hpp>
20 #include <bsoncxx/string/view_or_value.hpp>
21 #include <mongocxx/stdx.hpp>
22 
23 #include <mongocxx/config/prelude.hpp>
24 
25 namespace mongocxx {
26 MONGOCXX_INLINE_NAMESPACE_BEGIN
27 namespace options {
28 
29 class MONGOCXX_API change_stream {
30  public:
31  change_stream();
32 
51  change_stream& full_document(bsoncxx::string::view_or_value full_doc);
52 
59  const bsoncxx::stdx::optional<bsoncxx::string::view_or_value>& full_document() const;
60 
71  change_stream& batch_size(std::int32_t batch_size);
72 
79  const stdx::optional<std::int32_t>& batch_size() const;
80 
91  change_stream& resume_after(bsoncxx::document::view_or_value resume_after);
92 
99  const stdx::optional<bsoncxx::document::view_or_value>& resume_after() const;
100 
111  change_stream& collation(bsoncxx::document::view_or_value collation);
112 
119  const stdx::optional<bsoncxx::document::view_or_value>& collation() const;
120 
132  change_stream& max_await_time(std::chrono::milliseconds max_time);
133 
140  const stdx::optional<std::chrono::milliseconds>& max_await_time() const;
141 
142  private:
143  stdx::optional<bsoncxx::string::view_or_value> _full_document;
144  stdx::optional<std::int32_t> _batch_size;
145  stdx::optional<bsoncxx::document::view_or_value> _collation;
146  stdx::optional<bsoncxx::document::view_or_value> _resume_after;
147  stdx::optional<std::chrono::milliseconds> _max_await_time;
148 };
149 } // namespace options
150 MONGOCXX_INLINE_NAMESPACE_END
151 } // namespace mongocxx
152 
153 #include <mongocxx/config/postlude.hpp>
Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
Definition: change_stream.hpp:29
Class representing a view-or-value variant type.
Definition: view_or_value.hpp:30
Class representing a view-or-value variant type for strings.
Definition: view_or_value.hpp:36