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

Option to disable manipulators for Collection.find

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      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".

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: