@@ -109,6 +109,7 @@ def __init__(
109109 start_after : Optional [Mapping [str , Any ]],
110110 comment : Optional [Any ] = None ,
111111 full_document_before_change : Optional [str ] = None ,
112+ show_expanded_events : Optional [bool ] = None ,
112113 ) -> None :
113114 if pipeline is None :
114115 pipeline = []
@@ -143,6 +144,7 @@ def __init__(
143144 self ._comment = comment
144145 self ._closed = False
145146 self ._timeout = self ._target ._timeout
147+ self ._show_expanded_events = show_expanded_events
146148 # Initialize cursor.
147149 self ._cursor = self ._create_cursor ()
148150
@@ -175,6 +177,10 @@ def _change_stream_options(self):
175177
176178 if self ._start_at_operation_time is not None :
177179 options ["startAtOperationTime" ] = self ._start_at_operation_time
180+
181+ if self ._show_expanded_events :
182+ options ["showExpandedEvents" ] = self ._show_expanded_events
183+
178184 return options
179185
180186 def _command_options (self ):
@@ -230,6 +236,7 @@ def _run_aggregation_cmd(self, session, explicit_session):
230236 explicit_session ,
231237 result_processor = self ._process_result ,
232238 comment = self ._comment ,
239+ show_expanded_events = self ._show_expanded_events ,
233240 )
234241 return self ._client ._retryable_read (
235242 cmd .get_cursor , self ._target ._read_preference_for (session ), session
0 commit comments