studies
CtrlK
Workshop MongoDB
Workshop MongoDB
  • Objetivo
  • UML
  • UML em um banco de dados relacional
  • Opção 1 de agregação (acesso conjunto de dados)
  • Opção 2 de agregação (repetição de dados)
  • Instalando servidor MongoDB via Docker
  • MongoCompass
  • Prática - Criando Projeto Spring Boot com Docker
  • Compose.yaml
  • Entidades e mapeamento
    • User
    • Post
    • Author
    • Comment
    • Data base seeding
  • Endpoints
    • Users
      • UserDTO
      • findAll
      • findById
      • Insert
      • Update
      • Delete
    • Posts
      • PostDTO
      • GET userPost
      • findById
      • findByTitle (query methods)
      • findByTitle (query operators)
      • fullSearch (query methods)
        • Repository
        • Service
        • Controller
  • Tratamento de Exceções
Fornecido por GitBook
Nesta página
  1. Endpoints
  2. Posts
  3. fullSearch (query methods)

Repository

    @Query("{ $and: [ " +
            "{ 'moment': { $gte: ?1} }, " +
            "{ 'moment': { $lte: ?2}}," +
            "{ $or: [" +
            "{ 'title': { $regex: ?0, $options: 'i' } }, " +
            "{ 'body': { $regex: ?0, $options: 'i' } }, " +
            "{ 'comments.text': { $regex: ?0, $options: 'i' } } " +
            "]} " +
            "]}")
    List<Post> fullSearch(String text, Instant startMoment, Instant endMoment);
AnteriorfullSearch (query methods)PróximoService

Atualizado há 8 meses