Created
September 26, 2021 07:16
-
-
Save alex-ber/cc7ad4abbd6d86f2bd7f1fecf557ee80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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