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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.8.0
    • Affects Version/s: 3.7.1
    • Component/s: Query Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

              Assignee:
              Ross Lawley
              Reporter:
              Julien Buret
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: