MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
change_stream.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
23
26#include <bsoncxx/types.hpp>
28
30
31namespace mongocxx {
32namespace v_noabi {
33namespace options {
34
38class change_stream {
39 public:
40 MONGOCXX_ABI_EXPORT_CDECL() change_stream();
41
69 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
70 full_document(bsoncxx::v_noabi::string::view_or_value full_doc);
71
78 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
80
100 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
101 full_document_before_change(bsoncxx::v_noabi::string::view_or_value full_doc_before_change);
102
109 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> const&)
111
122 MONGOCXX_ABI_EXPORT_CDECL(change_stream&) batch_size(std::int32_t batch_size);
123
130 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::int32_t> const&)
131 batch_size() const;
132
143 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
144 comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment);
145
153 bsoncxx::v_noabi::types::bson_value::view_or_value> const&)
154 comment() const;
155
171 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
172 resume_after(bsoncxx::v_noabi::document::view_or_value resume_after);
173
180 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
182
200 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
201 start_after(bsoncxx::v_noabi::document::view_or_value token);
202
209 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
210 start_after() const;
211
222 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
223 collation(bsoncxx::v_noabi::document::view_or_value collation);
224
231 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const&)
232 collation() const;
233
245 MONGOCXX_ABI_EXPORT_CDECL(change_stream&) max_await_time(std::chrono::milliseconds max_time);
246
253 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::chrono::milliseconds> const&)
255
270 MONGOCXX_ABI_EXPORT_CDECL(change_stream&)
271 start_at_operation_time(bsoncxx::v_noabi::types::b_timestamp timestamp);
272
279 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::stdx::optional<bsoncxx::v_noabi::types::b_timestamp> const&)
281
282 private:
283 friend ::mongocxx::v_noabi::client;
284 friend ::mongocxx::v_noabi::collection;
285 friend ::mongocxx::v_noabi::database;
286
287 bsoncxx::v_noabi::document::value as_bson() const;
288
289 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _full_document;
290 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value> _full_document_before_change;
291 bsoncxx::v_noabi::stdx::optional<std::int32_t> _batch_size;
292 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _comment;
293 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _collation;
294 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _resume_after;
295 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _start_after;
296 bsoncxx::v_noabi::stdx::optional<std::chrono::milliseconds> _max_await_time;
297 bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::b_timestamp> _start_at_operation_time;
298};
299
300} // namespace options
301} // namespace v_noabi
302} // namespace mongocxx
303
304#include <mongocxx/config/postlude.hpp>
305
A MongoDB collection.
Definition collection.hpp:87
A MongoDB database.
Definition database.hpp:46
change_stream & resume_after(bsoncxx::v_noabi::document::view_or_value resume_after)
Specifies the logical starting point for the new change stream.
change_stream & batch_size(std::int32_t batch_size)
Sets the number of documents to return per batch.
change_stream & start_after(bsoncxx::v_noabi::document::view_or_value token)
Specifies the logical starting point of the new change stream. The new stream will return the first n...
change_stream & start_at_operation_time(bsoncxx::v_noabi::types::b_timestamp timestamp)
Specifies the logical starting point for the new change stream. Changes are returned at or after the ...
change_stream & max_await_time(std::chrono::milliseconds max_time)
Sets the maximum amount of time for for the server to wait on new documents to satisfy a change strea...
change_stream & full_document(bsoncxx::v_noabi::string::view_or_value full_doc)
Sets the fullDocument option for the $changeStream.
change_stream & collation(bsoncxx::v_noabi::document::view_or_value collation)
Sets the collation for this operation.
change_stream & full_document_before_change(bsoncxx::v_noabi::string::view_or_value full_doc_before_change)
Sets the fullDocumentBeforeChange option for the $changeStream.
change_stream & comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment)
Sets the current value of the comment option.
Used by clients.
Definition client.hpp:37
Declares mongocxx::v_noabi::client.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Provides bsoncxx::v_noabi::document::view_or_value.
#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.
Declares mongocxx::v_noabi::options::change_stream.
Provides bsoncxx::v_noabi::string::view_or_value.
Provides bsoncxx::v_noabi::types::bson_value::view_or_value.
Provides entities used to represent BSON types.