class MongoDbRegionRepository implements RegionRepository {

    @Override
    public List<Region> getAll(){

        Query q = new Query();

        List<Page> allPages = template.find(q);

        List<Region> regions = new ArrayList<Region>();

        for(Page page: allPages){
            List<Region> rgns = page.getRegions();
            if(rgns != null){
                for(Region region : rgns) {
                    regions.add(region);
                }
            }

        }

        return regions;
    }

}