class VitamMongoRepository implements VitamRepository {

    @Override
    public void removeByNameAndTenant(String name, Integer tenant) throws DatabaseException {

        ParametersChecker.checkParameter(ALL_PARAMS_REQUIRED, name, tenant);
        Bson query = and(eq(VitamDocument.TENANT_ID, tenant), eq(NAME, name));
        DeleteResult delete = collection.deleteOne(query);
        long count = delete.getDeletedCount();
        if (count == 0) {
            LOGGER.error(String
                .format("Error while removeByNameAndTenant> Name : %s and tenant: %s",
                    name, tenant));
            throw new DatabaseException(String
                .format("Error while removeByNameAndTenant> Name : %s and tenant: %s",
                    name, tenant));
        }

    }

    public  VitamMongoRepository(MongoCollection<Document> collection);

}