Skip to content

Instantly share code, notes, and snippets.

@alex-ber
Created September 26, 2021 07:16
Show Gist options
  • Select an option

  • Save alex-ber/cc7ad4abbd6d86f2bd7f1fecf557ee80 to your computer and use it in GitHub Desktop.

Select an option

Save alex-ber/cc7ad4abbd6d86f2bd7f1fecf557ee80 to your computer and use it in GitHub Desktop.
package com.mkyong.domain;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import java.util.List;
public interface DomainRepository extends MongoRepository<Domain, Long> {
Domain findByDomainAndIP(String domain, String ip);
@Query("{domain: { $regex: ?0 } })")
List<Domain> findCustomByRegExDomain(String domain);
//how to update a particular field? save() is not what I want.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment