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

Option to disable manipulators for Collection.find

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible

      Both Collection.insert and Collection.update provide a named parameter to disable manipulators: "manipulate=False".
      This option should also be available for the "find" method.

      Going into implementation details: when "manipulate" is set to False the code for Cursor.next can be simplified to:

      def next(self):
      if not self.__empty:
      if len(self.__data) or self._refresh():
      return self.__data.pop(0)
      raise StopIteration

      Cursor._init_ could switch between both implementations of "next" according to the value of "manipulate".

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            unbeknownst unbeknownst
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: