use of org.bson.codecs.BsonDocumentCodec in project mongo-java-driver by mongodb.
the class CommandMonitoringTest method getWritableCloneOfCommand.
private BsonDocument getWritableCloneOfCommand(final BsonDocument original) {
BsonDocument clone = new BsonDocument();
BsonDocumentWriter writer = new BsonDocumentWriter(clone);
new BsonDocumentCodec(CODEC_REGISTRY_HACK).encode(writer, original, EncoderContext.builder().build());
return clone;
}
Aggregations