private OperationExecutor getExecutor() { try { // this is hack to get executor // hope will be removed when 3 series driver have explain function com.mongodb.client.MongoDatabase mongoDb = mongoDatabase.getMongoDb(); Field f = mongoDb.getClass().getDeclaredField("executor"); f.setAccessible(true); return (OperationExecutor) f.get(mongoDb); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { log.error("Exception:", e); return null; } }
private MongoCollection<Document> getCollection() { return mongoDatabase.getMongoDb().getCollection(collectionName); }