Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2592

find_raw_batches raises exception on Views

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.11.3
    • Component/s: API
    • Labels:
      None

      When calling `find_raw_batches` or `aggregate_raw_batches` on a view, an OperationError is raised.

       

      Is there a workaround for reading raw batches using `RawBSONDocument`?

       

      _ = list(col.find_raw_batches())
      Traceback (most recent call last):
        File "....\site-packages\IPython\core\interactiveshell.py", line 3417, in run_code
          exec(code_obj, self.user_global_ns, self.user_ns)
        File "<ipython-input-2-e7c3c6f57470>", line 2, in <module>
          _ = list(col.find_raw_batches())
        File "....\site-packages\pymongo\cursor.py", line 1207, in next
          if len(self.__data) or self._refresh():
        File "....\site-packages\pymongo\cursor.py", line 1124, in _refresh
          self.__send_message(q)
        File "....\site-packages\pymongo\cursor.py", line 1001, in __send_message
          address=self.__address)
        File "....\site-packages\pymongo\mongo_client.py", line 1372, in _run_operation_with_response
          exhaust=exhaust)
        File "....\site-packages\pymongo\mongo_client.py", line 1471, in _retryable_read
          return func(session, server, sock_info, slave_ok)
        File "....\site-packages\pymongo\mongo_client.py", line 1366, in _cmd
          unpack_res)
        File "....\site-packages\pymongo\server.py", line 131, in run_operation_with_response
          user_fields=user_fields)
        File "....\site-packages\pymongo\cursor.py", line 1298, in _unpack_response
          return response.raw_response(cursor_id)
        File "....\site-packages\pymongo\message.py", line 1528, in raw_response
          error_object)
      pymongo.errors.OperationFailure: database error: Namespace **** is a view, not a collection, full error: {'$err': 'Namespace **** is a view, not a collection', 'code': 166, 'ok': 0.0}
      
      

            Assignee:
            prashant.mital Prashant Mital (Inactive)
            Reporter:
            linar@jether-energy.com Linar Savion
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: