class MongoDbPageRepository implements PageRepository {

    @Override
    public List<Page> getAllPagesForUserType(String userId, String pageType) {
        return sort(template.find(query(where("pageType").is(getString(pageType)).andOperator(where("members").elemMatch(where("userId").is(userId))))), userId);
    }

}