Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13638

Java driver docs refer to old MongoIterable#forEach(Block<T>)

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: drivers
    • Labels:
    • Last comment by Customer:
      true
    • Story Points:
      2
    • Sprint:
      DET: FY2021Q1S8, DET: FY2021Q2S2, DET: FY2021Q2S3

      Description

      Description

      Hello,

      our documentation pages at https://docs.mongodb.com/guides/server/read/ for Java and also http://mongodb.github.io/mongo-java-driver/4.0/driver/tutorials/perform-read-operations/ refer to the old forEach printBlock method, which no longer works.

      I worked around the issue via the built-in Java 8 forEach and this consumer:

      		Consumer<Document> printBlock = new Consumer<Document>() {
      		    public void accept(final Document doc) {
      		        System.out.println(doc.toJson());
      		    };
      		};

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

        Attachments

          Activity

            People

            Assignee:
            chris.cho Christopher Cho
            Reporter:
            torsten.spindler Torsten Spindler
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              1 year, 7 weeks, 1 day ago
              Date of 1st Reply: