MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
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
29#include <mongocxx/stdx.hpp>
30
32
33namespace mongocxx {
34namespace v_noabi {
35namespace options {
36
41 public:
43
72 full_document(bsoncxx::v_noabi::string::view_or_value full_doc);
73
81 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
83
104 full_document_before_change(bsoncxx::v_noabi::string::view_or_value full_doc_before_change);
105
113 const bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::string::view_or_value>&)
115
127
134 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::int32_t>&) batch_size() const;
135
147 comment(bsoncxx::v_noabi::types::bson_value::view_or_value comment);
148
156 const stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value>&)
157 comment() const;
158
175 resume_after(bsoncxx::v_noabi::document::view_or_value resume_after);
176
183 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
185
204 start_after(bsoncxx::v_noabi::document::view_or_value token);
205
212 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
213 start_after() const;
214
226 collation(bsoncxx::v_noabi::document::view_or_value collation);
227
234 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<bsoncxx::v_noabi::document::view_or_value>&)
235 collation() const;
236
249
256 MONGOCXX_ABI_EXPORT_CDECL(const stdx::optional<std::chrono::milliseconds>&)
258
274 start_at_operation_time(bsoncxx::v_noabi::types::b_timestamp timestamp);
275
276 private:
277 friend ::mongocxx::v_noabi::client;
278 friend ::mongocxx::v_noabi::collection;
279 friend ::mongocxx::v_noabi::database;
280
281 bsoncxx::v_noabi::document::value as_bson() const;
282
283 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _full_document;
284 stdx::optional<bsoncxx::v_noabi::string::view_or_value> _full_document_before_change;
285 stdx::optional<std::int32_t> _batch_size;
286 stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> _comment;
287 stdx::optional<bsoncxx::v_noabi::document::view_or_value> _collation;
288 stdx::optional<bsoncxx::v_noabi::document::view_or_value> _resume_after;
289 stdx::optional<bsoncxx::v_noabi::document::view_or_value> _start_after;
290 stdx::optional<std::chrono::milliseconds> _max_await_time;
291 // _start_at_operation_time is not wrapped in a stdx::optional because of a longstanding bug in
292 // the MNMLSTC polyfill that has been fixed on master, but not in the latest release:
293 // https://github.com/mnmlstc/core/pull/23
294 bsoncxx::v_noabi::types::b_timestamp _start_at_operation_time = {};
295 bool _start_at_operation_time_set = false;
296};
297
298} // namespace options
299} // namespace v_noabi
300} // namespace mongocxx
301
303
Class representing server side document groupings within a MongoDB database.
Definition collection.hpp:87
Class representing a MongoDB database.
Definition database.hpp:47
Class representing MongoDB change stream options.
Definition change_stream.hpp:40
const stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > & comment() const
Gets the current value of the comment option.
const stdx::optional< std::chrono::milliseconds > & max_await_time() const
The current max_time setting.
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & collation() const
Retrieves the current collation for this operation.
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 ...
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & start_after() const
Retrieves the current startAfter token for this change stream.
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & resume_after() const
Retrieves the current resumeToken for this change stream.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & full_document_before_change() const
Gets the current fullDocumentBeforeChange option.
const bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > & full_document() const
Gets the current fullDocument option.
const stdx::optional< std::int32_t > & batch_size() const
The current batch size setting.
Class representing the optional arguments to a MongoDB driver client object.
Definition client.hpp:39
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 fwd.hpp:222
The mongocxx macro guard postlude header.
The mongocxx 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.
The top-level namespace reserved for the C++ standard library.
Declares mongocxx::v_noabi::options::change_stream.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.
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.