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

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

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: drivers
    • Labels:
    • 2

      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.)

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

              Created:
              Updated:
              Resolved:
              3 years, 44 weeks, 6 days ago