Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2894

FindIterable.map().first() does not seem to close the underlying cursor

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.8.0
    • 3.7.1
    • Query Operations
    • None

    Description

      With the current MappingIterable.first() implementation:

       

      @Nullable@Overridepublic V first() {
      MongoCursor<V> iterator = iterator();
      if (!iterator.hasNext()) {
      return null;
      }
      return iterator.next();
      }

       

      It seems that the MongoCursor.close() method is not called on a col.find().map().first() call.

      HTH

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            jburet Julien Buret
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: