Skip to content

Commit

Permalink
MOTOR-939 Improved change stream event visibility for C2C Replication (
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Jan 11, 2023
1 parent 8b2c17f commit 8d5a8bc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions motor/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def watch(
start_after=None,
comment=None,
full_document_before_change=None,
show_expanded_events=None,
):
"""Watch changes on this cluster.
Expand Down Expand Up @@ -214,10 +215,14 @@ def watch(
command.
- `full_document_before_change`: Allowed values: `whenAvailable` and `required`. Change events
may now result in a `fullDocumentBeforeChange` response field.
- `show_expanded_events` (optional): Include expanded events such as DDL events like `dropIndexes`.
:Returns:
A :class:`~MotorChangeStream`.
.. versionchanged:: 3.2
Added ``show_expanded_events`` parameter.
.. versionchanged:: 3.1
Added ``full_document_before_change`` parameter.
Expand Down Expand Up @@ -249,6 +254,7 @@ def watch(
start_after,
comment,
full_document_before_change,
show_expanded_events,
)

def __getattr__(self, name):
Expand Down Expand Up @@ -629,6 +635,7 @@ def watch(
start_after=None,
comment=None,
full_document_before_change=None,
show_expanded_events=None,
):
"""Watch changes on this database.
Expand Down Expand Up @@ -673,10 +680,14 @@ def watch(
command.
- `full_document_before_change`: Allowed values: `whenAvailable` and `required`. Change events
may now result in a `fullDocumentBeforeChange` response field.
- `show_expanded_events` (optional): Include expanded events such as DDL events like `dropIndexes`.
:Returns:
A :class:`~MotorChangeStream`.
.. versionchanged:: 3.2
Added ``show_expanded_events`` parameter.
.. versionchanged:: 3.1
Added ``full_document_before_change`` parameter.
Expand Down Expand Up @@ -708,6 +719,7 @@ def watch(
start_after,
comment,
full_document_before_change,
show_expanded_events,
)

@property
Expand Down Expand Up @@ -1047,6 +1059,7 @@ def watch(
start_after=None,
comment=None,
full_document_before_change=None,
show_expanded_events=None,
):
"""Watch changes on this collection.
Expand Down Expand Up @@ -1146,12 +1159,16 @@ def main():
command.
- `full_document_before_change`: Allowed values: `whenAvailable` and `required`. Change events
may now result in a `fullDocumentBeforeChange` response field.
- `show_expanded_events` (optional): Include expanded events such as DDL events like `dropIndexes`.
:Returns:
A :class:`~MotorChangeStream`.
See the :ref:`tornado_change_stream_example`.
.. versionchanged:: 3.2
Added ``show_expanded_events`` parameter.
.. versionchanged:: 3.1
Added ``full_document_before_change`` parameter.
Expand Down Expand Up @@ -1186,6 +1203,7 @@ def main():
start_after,
comment,
full_document_before_change,
show_expanded_events,
)

def list_indexes(self, session=None, **kwargs):
Expand Down Expand Up @@ -1786,6 +1804,7 @@ def __init__(
start_after,
comment,
full_document_before_change,
show_expanded_events,
):
super().__init__(delegate=None)
# The "target" object is a client, database, or collection.
Expand All @@ -1802,6 +1821,7 @@ def __init__(
"start_after": start_after,
"comment": comment,
"full_document_before_change": full_document_before_change,
"show_expanded_events": show_expanded_events,
}

def _lazy_init(self):
Expand Down

0 comments on commit 8d5a8bc

Please sign in to comment.