From 57a13bc371b1370be7342164254a5e9e72828146 Mon Sep 17 00:00:00 2001 From: 101 Date: Tue, 13 Feb 2024 11:59:39 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=80=EC=83=89=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 대소문자 구분 X --- .../domain/document/repository/DocumentRepository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/example/daemawiki/domain/document/repository/DocumentRepository.java b/src/main/java/com/example/daemawiki/domain/document/repository/DocumentRepository.java index e72204c2..8abe34bc 100644 --- a/src/main/java/com/example/daemawiki/domain/document/repository/DocumentRepository.java +++ b/src/main/java/com/example/daemawiki/domain/document/repository/DocumentRepository.java @@ -1,6 +1,7 @@ package com.example.daemawiki.domain.document.repository; import com.example.daemawiki.domain.document.model.DefaultDocument; +import org.springframework.data.mongodb.repository.Query; import org.springframework.data.mongodb.repository.ReactiveMongoRepository; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -8,6 +9,7 @@ public interface DocumentRepository extends ReactiveMongoRepository { Mono findByTitle(String title); - Flux findAllByGroupsContains(String group); + @Query("{'$or':[{'title':{$regex:'?0', $options:'i'}}, {'content':{$regex:'?0', $options:'i'}}]}") + Flux findByTextContaining(String text); }