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

Improve the support for mapped find iterables

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

      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

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

              Created:
              Updated:
              Resolved: