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

Sync the POJO quickstart doc with PojoQuickTour.java

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Hey everyone,

      I was going through the POJO doc (http://mongodb.github.io/mongo-java-driver/3.10/driver/getting-started/quick-start-pojo/) of JAVA driver 3.10 when I found out that the example on the page does not work.

      For example:

      CodecRegistry pojoCodecRegistry = fromRegistries(MongoClient.getDefaultCodecRegistry(),
                      fromProviders(PojoCodecProvider.builder().automatic(true).build()));
      

      won't work, because the MongoClient class has been refactored and it doesn't have that method. MongoClientSettings should be used.

      By checking out https://github.com/mongodb/mongo-java-driver/blob/master/driver-sync/src/examples/tour/PojoQuickTour.java , that code works well and up-to-date.

      I think the previous docs (e.g. 3.9 ) have the same example codes, so they might won't work as well.

       

            Assignee:
            john.stewart@mongodb.com John Stewart (Inactive)
            Reporter:
            csaba.turcsan Csaba Turcsán
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: