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

Improve the support for mapped find iterables

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.4
    • Fix Version/s: None
    • Component/s: API, Query Operations
    • Labels:
      None

      Description

      Currently, when calling FindIterable#map, the API will only return a MongoIterable, limiting the options to further adjust the cursor after mapping it like in the following example:

      MongoClient client = MongoClients.create();
      MongoDatabase database = client.getDatabase("abc");
      MongoCollection<Document> collection = database.getCollection("collection");
      FindIterable<Document> iterable = collection.find();
      MongoIterable<String> mappedIterable = iterable.map(Document::toJson);

      The resulting MongoIterable now does not provide useful FindIterable methods like FindIterable#limit, FindIterable#sort and so on. I have opened up a Pull-Request for this feature on GitHub: https://github.com/mongodb/mongo-java-driver/pull/551

        Attachments

          Activity

            People

            Assignee:
            jeff.yemin Jeffrey Yemin
            Reporter:
            mail@moritz-hennen.de Moritz Hennen
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: