Loading...
Searching...
No Matches
mongocxx::options::change_stream Class Reference

`#include <mongocxx/v_noabi/mongocxx/options/change_stream.hpp>`

## Description

Used by change streams.

## Public Member Functions

| change_stream ()=default
| Default initialization.
| change_stream (v1::change_stream::options opts)
| Construct with the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< std::int32_t > const & | batch_size () const
| The current batch size setting.
change_stream & | 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 & | collation () const
| Retrieves the current collation for this operation.
change_stream & | collation (bsoncxx::v_noabi::document::view_or_value collation)
| Sets the collation for this operation.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & | comment () const
| Gets the current value of the comment option.
change_stream & | comment (bsoncxx::v_noabi::types::bson_value::view_or_value comment)
| Sets the current value of the comment option.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & | full_document () const
| Gets the current fullDocument option.
change_stream & | full_document (bsoncxx::v_noabi::string::view_or_value full_doc)
| Sets the fullDocument option for the $changeStream.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & | full_document_before_change () const
| Gets the current fullDocumentBeforeChange option.
change_stream & | full_document_before_change (bsoncxx::v_noabi::string::view_or_value full_doc_before_change)
| Sets the fullDocumentBeforeChange option for the $changeStream.
bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > const & | max_await_time () const
| The current max_time setting.
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 stream query.
| operator v1::change_stream::options () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & | resume_after () const
| Retrieves the current resumeToken for this change stream.
change_stream & | resume_after (bsoncxx::v_noabi::document::view_or_value resume_after)
| Specifies the logical starting point for the new change stream.
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & | start_after () const
| Retrieves the current startAfter token for this change stream.
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 notification after the given token.
bsoncxx::stdx::optional< bsoncxx::v_noabi::types::b_timestamp > const & | start_at_operation_time () const
| The current start_at_operation_time setting.
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 specified operation time.

## Constructor & Destructor Documentation

## change_stream() [1/2]

mongocxx::v_noabi::options::change_stream::change_stream | ( |  | ) |

default

Default initialization.

## change_stream() [2/2]

mongocxx::v_noabi::options::change_stream::change_stream | ( | v1::change_stream::options | opts | ) |

Construct with the mongocxx::v1 equivalent.

## Member Function Documentation

## batch_size() [1/2]

bsoncxx::v_noabi::stdx::optional< std::int32_t > const & mongocxx::v_noabi::options::change_stream::batch_size | ( |  | ) | const

inline

The current batch size setting.

Returns
  The current batch size.

## batch_size() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::batch_size | ( | std::int32_t | batch_size | ) |

inline

Sets the number of documents to return per batch.

Parameters

  batch_size | The size of the batches to request.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## collation() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::change_stream::collation | ( |  | ) | const

inline

Retrieves the current collation for this operation.

Returns
  The current collation.

## collation() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::collation | ( | bsoncxx::v_noabi::document::view_or_value | collation | ) |

inline

Sets the collation for this operation.

Parameters

  collation | The new collation.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## comment() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::types::bson_value::view_or_value > const & mongocxx::v_noabi::options::change_stream::comment | ( |  | ) | const

inline

Gets the current value of the comment option.

Returns
  The current comment option.

## comment() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::comment | ( | bsoncxx::v_noabi::types::bson_value::view_or_value | comment | ) |

inline

Sets the current value of the comment option.

Parameters

  comment | The new comment option.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## full_document() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & mongocxx::v_noabi::options::change_stream::full_document | ( |  | ) | const

inline

Gets the current fullDocument option.

Returns
  The current fullDocument option.

## full_document() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::full_document | ( | bsoncxx::v_noabi::string::view_or_value | full_doc | ) |

inline

Sets the fullDocument option for the $changeStream.

Allowed values: 'default', 'updateLookup', 'whenAvailable', 'required'.

The default is to not send a value, which is equivalent to 'default'. By default, the change notification for partial updates will include a delta describing the changes to the document.

When set to 'updateLookup', the change notification for partial updates will include both a delta describing the changes to the document as well as a copy of the entire document that was changed from some time after the change occurred.

When set to 'whenAvailable', configures the change stream to return the post-image of the modified document for replace and update change events if the post-image for this event is available.

When set to 'required', the same behavior as 'whenAvailable' except that an error is raised if the post-image is not available.

Parameters

  full_doc | The fullDocument option to use on this stream.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## full_document_before_change() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::string::view_or_value > const & mongocxx::v_noabi::options::change_stream::full_document_before_change | ( |  | ) | const

inline

Gets the current fullDocumentBeforeChange option.

Returns
  The current fullDocumentBeforeChange option.

## full_document_before_change() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::full_document_before_change | ( | bsoncxx::v_noabi::string::view_or_value | full_doc_before_change | ) |

inline

Sets the fullDocumentBeforeChange option for the $changeStream.

The allowed values are: 'whenAvailable', 'required', 'off'. If none set, defaults to 'off'.

When set to 'whenAvailable', configures the change stream to return the pre-image of the modified document for replace, update, and delete change events if it is available.

When set to 'required', the same behavior as 'whenAvailable' except that an error is raised if the pre-image is not available.

Parameters

  full_doc_before_change | The fullDocumentBeforeChange option to use on this stream.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## max_await_time() [1/2]

bsoncxx::v_noabi::stdx::optional< std::chrono::milliseconds > const & mongocxx::v_noabi::options::change_stream::max_await_time | ( |  | ) | const

inline

The current max_time setting.

Returns
  The current max time (in milliseconds).

## max_await_time() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::max_await_time | ( | std::chrono::milliseconds | max_time | ) |

inline

Sets the maximum amount of time for for the server to wait on new documents to satisfy a change stream query.

Parameters

  max_time | The max amount of time (in milliseconds) for the server to wait on new documents.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## operator v1::change_stream::options()

mongocxx::v_noabi::options::change_stream::operator v1::change_stream::options | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## resume_after() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::change_stream::resume_after | ( |  | ) | const

inline

Retrieves the current resumeToken for this change stream.

Returns
  The current resumeToken.

## resume_after() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::resume_after | ( | bsoncxx::v_noabi::document::view_or_value | resume_after | ) |

inline

Specifies the logical starting point for the new change stream.

The value returned by calling change_stream::get_resume_token can be used here.

start_after, resume_after, and start_at_operation_time are mutually exclusive options. Setting more than one of these will result in a server error.

Parameters

  resume_after | The resumeToken to use when starting the change stream.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

## start_after() [1/2]

bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & mongocxx::v_noabi::options::change_stream::start_after | ( |  | ) | const

inline

Retrieves the current startAfter token for this change stream.

Returns
  The current startAfter token.

## start_after() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::start_after | ( | bsoncxx::v_noabi::document::view_or_value | token | ) |

inline

Specifies the logical starting point of the new change stream. The new stream will return the first notification after the given token.

The value returned by calling change_stream::get_resume_token can be used here.

Unlike resumeAfter, this can resume notifications after an "invalidate" event.

start_after, resume_after, and start_at_operation_time are mutually exclusive options. Setting more than one of these will result in a server error.

Parameters

  token | The token representing the logical starting point of the change stream.

Returns
  A reference to the object on which this function is being called.

## start_at_operation_time() [1/2]

bsoncxx::stdx::optional< bsoncxx::v_noabi::types::b_timestamp > const & mongocxx::v_noabi::options::change_stream::start_at_operation_time | ( |  | ) | const

inline

The current start_at_operation_time setting.

Returns
  The current startAtOperationTime option.

## start_at_operation_time() [2/2]

change_stream & mongocxx::v_noabi::options::change_stream::start_at_operation_time | ( | bsoncxx::v_noabi::types::b_timestamp | timestamp | ) |

inline

Specifies the logical starting point for the new change stream. Changes are returned at or after the specified operation time.

start_after, resume_after, and start_at_operation_time are mutually exclusive options. Setting more than one of these will result in a server error.

Parameters

  timestamp | The starting operation time.

Returns
  A reference to the object on which this member function is being called. This facilitates method chaining.

The documentation for this class was generated from the following file:

- mongocxx/v_noabi/mongocxx/options/change_stream.hpp