Skip to content

Commit

Permalink
feat(client): allow to access the pojo codec repository of a collection
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jan 20, 2020
1 parent 2e9444c commit 867fdea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.concurrent.CompletionStage;

import org.bson.Document;
import org.bson.codecs.configuration.CodecRegistry;
import org.bson.conversions.Bson;
import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder;

Expand All @@ -30,6 +31,13 @@ public interface ReactiveMongoCollection<T> {
*/
MongoNamespace getNamespace();

/**
* Gets the codec registry of this collection.
*
* @return the codec registry
*/
CodecRegistry getCodecRegistry();

/**
* Get the class of documents stored in this collection.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.concurrent.CompletionStage;

import org.bson.Document;
import org.bson.codecs.configuration.CodecRegistry;
import org.bson.conversions.Bson;
import org.eclipse.microprofile.reactive.streams.operators.PublisherBuilder;
import org.eclipse.microprofile.reactive.streams.operators.ReactiveStreams;
Expand Down Expand Up @@ -59,6 +60,11 @@ public MongoNamespace getNamespace() {
return collection.getNamespace();
}

@Override
public CodecRegistry getCodecRegistry() {
return collection.getCodecRegistry();
}

@Override
public Class<T> getDocumentClass() {
return collection.getDocumentClass();
Expand Down

0 comments on commit 867fdea

Please sign in to comment.