diff --git a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/persistence/ElasticRepositoryMongoDB.java b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/persistence/ElasticRepositoryMongoDB.java
index cbbfe46ec103f9532c8e1fd41899352568b8a701..ea6b2da9de66747da3fa72b57d00ea424dac4669 100644
--- a/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/persistence/ElasticRepositoryMongoDB.java
+++ b/provider/indexer-reference/src/main/java/org/opengroup/osdu/indexer/persistence/ElasticRepositoryMongoDB.java
@@ -18,7 +18,7 @@
 package org.opengroup.osdu.indexer.persistence;
 
 import static com.mongodb.client.model.Filters.eq;
-import static com.mongodb.util.JSON.serialize;
+import static com.mongodb.BasicDBObject.parse;
 
 import com.google.gson.Gson;
 import com.mongodb.client.MongoCollection;
@@ -75,7 +75,7 @@ public class ElasticRepositoryMongoDB implements IElasticRepository {
           SETTINGS_FETCH_ERROR_MESSAGE);
     }
 
-    ElasticSettingsDoc elasticSettingsDoc = new Gson().fromJson(serialize(record),
+    ElasticSettingsDoc elasticSettingsDoc = new Gson().fromJson(String.valueOf(parse(record.toString())),
         ElasticSettingsDoc.class);
 
     try {