From c3cc02ee372faa747f6d8ff4e9851e5406229fcc Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 18 Mar 2022 14:14:53 -0700 Subject: [PATCH] add in more routing to hopefully make it work --- pymongo/aggregation.py | 1 + pymongo/command_cursor.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pymongo/aggregation.py b/pymongo/aggregation.py index 84ecffe5f..62fe4bd05 100644 --- a/pymongo/aggregation.py +++ b/pymongo/aggregation.py @@ -174,6 +174,7 @@ class _AggregationCommand(object): max_await_time_ms=self._max_await_time_ms, session=session, explicit_session=self._explicit_session, + comment=self._options.get("comment"), ) cmd_cursor._maybe_pin_connection(sock_info) return cmd_cursor diff --git a/pymongo/command_cursor.py b/pymongo/command_cursor.py index 0809d34e6..0c7fd6740 100644 --- a/pymongo/command_cursor.py +++ b/pymongo/command_cursor.py @@ -158,8 +158,6 @@ class CommandCursor(Generic[_DocumentType]): def __send_message(self, operation): """Send a getmore message and handle the response.""" client = self.__collection.database.client - if self.__comment is not None: - operation["comment"] = self.__comment try: response = client._run_operation( operation, self._unpack_response, address=self.__address @@ -211,7 +209,6 @@ class CommandCursor(Generic[_DocumentType]): """ if len(self.__data) or self.__killed: return len(self.__data) - if self.__id: # Get More dbname, collname = self.__ns.split(".", 1) read_pref = self.__collection._read_preference_for(self.session)