class VitamMongoRepository implements VitamRepository {

    @Override
    public Optional<Document> getByID(String id, Integer tenant) throws DatabaseException {
        ParametersChecker.checkParameter(ALL_PARAMS_REQUIRED, id);
        try {
            FindIterable<Document> result = collection.find(new BasicDBObject(ID, id));
            if (result.iterator().hasNext()) {
                return Optional.of(result.first());
            } else {
                return Optional.empty();
            }
        } catch (Exception e) {
            LOGGER.error(String.format("DatabaseException while getting document by id : %s", id), e);
            throw new DatabaseException(String.format("DatabaseException while getting document by id : %s", id), e);
        }
    }

    public  VitamMongoRepository(MongoCollection<Document> collection);

}