-
Type: Improvement
-
Resolution: Fixed
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: Documentation
I'm looking at this example at http://mongodb.github.io/mongo-java-driver/3.7/bson/pojos/
import org.bson.codecs.configuration.CodecProvider; import org.bson.codecs.configuration.CodecRegistry; import static org.bson.codecs.configuration.CodecRegistries.fromRegistries; import static org.bson.codecs.configuration.CodecRegistries.fromProviders; // Create a CodecRegistry containing the PojoCodecProvider instance. CodecProvider pojoCodecProvider = PojoCodecProvider.builder().register("org.example.pojos").build(); CodecRegistry pojoCodecRegistry = fromRegistries( defaultCodecRegistry, fromProviders(pojoCodecProvider));
Nowhere on this page is defaultCodeRegistry assigned.
Maybe we add
CodecRegistry defaultCodecRegistry = MongoClientSettings.getDefaultCodecRegistry()
at least for the first example?