[JAVA-3213] Sync the POJO quickstart doc with PojoQuickTour.java Created: 22/Feb/19  Updated: 21/Jan/20  Resolved: 21/Jan/20

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Trivial - P5
Reporter: Csaba Turcsán Assignee: John Stewart (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.

 


Generated at Thu Feb 08 08:59:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.