[JAVA-2426] Support DBRef codec in async driver (MongoClients.DEFAULT_CODEC_REGISTRY) Created: 17/Jan/17  Updated: 03/May/17  Resolved: 03/May/17

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

Type: New Feature Priority: Major - P3
Reporter: Mark Paluch Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Storing DBRef with the RxJava/ReactiveStreams driver fails because no codec can be found for DBRef. Currently, the async driver CodecRegistry is configured with:

private static final CodecRegistry DEFAULT_CODEC_REGISTRY =
            fromProviders(asList(new ValueCodecProvider(),
                    new DocumentCodecProvider(),
                    new BsonValueCodecProvider(),
                    new IterableCodecProvider(),
                    new GeoJsonCodecProvider(),
                    new GridFSFileCodecProvider()));

Please add the DBRefCodec and the DBRef <-> Document transformation so references can be used from the asynchronous/reactive drivers.



 Comments   
Comment by Githook User [ 03/May/17 ]

Author:

{u'username': u'rozza', u'name': u'Ross Lawley', u'email': u'ross.lawley@gmail.com'}

Message: Added the ability to use DBRefs with the async driver

Moved DBRef, DBRefCodec, DBRefCodecProvider and DocumentToDBRefTransformer into driver-core
Updated the DEFAULT_CODEC_REGISTRY for the async driver

JAVA-2426
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2b81f0bf1c2c961052a64d1c11f07ca3ec1c39e5

Comment by Ross Lawley [ 28/Apr/17 ]

PR: https://github.com/rozza/mongo-java-driver/pull/193

Comment by Ross Lawley [ 17/Jan/17 ]

mp911de many thanks for the ticket.

Will look to add in the next release, in the meantime please use the CodecRegistries helper methods to extend the DEFAULT_CODEC_REGISTRY to provide support for DBRefs.

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