Browse Source

Repo search ignore case

master
RENOX 5 months ago
parent
commit
e2f20bd9e7
4 changed files with 5 additions and 2 deletions
  1. +1
    -0
      pom.xml
  2. +1
    -1
      src/main/java/planetrenox/controller/FormController.java
  3. +2
    -1
      src/main/java/planetrenox/mongodb/DungeonRepository.java
  4. +1
    -0
      src/main/resources/application.properties

+ 1
- 0
pom.xml View File

@@ -19,6 +19,7 @@

<properties>
<java.version>11</java.version>
<start-class>com.planetrenox.TextdungeonApplication</start-class>
</properties>

<dependencies>


+ 1
- 1
src/main/java/planetrenox/controller/FormController.java View File

@@ -27,7 +27,7 @@ public class FormController
else // Validation Successful
{
name = (String)loginDocument.get("CLEAN_NAME");
Dungeon dungeon = repository.findByName(name);
Dungeon dungeon = repository.findByNameIgnoreCase(name);
if (dungeon==null) // New User
{
Map<String, Object> newDocument = new HashMap<>();


+ 2
- 1
src/main/java/planetrenox/mongodb/DungeonRepository.java View File

@@ -2,9 +2,10 @@ package planetrenox.mongodb;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

public interface DungeonRepository extends MongoRepository<Dungeon, String>
{
public Dungeon findByName(String name);
public Dungeon findByNameIgnoreCase(String name);
}

+ 1
- 0
src/main/resources/application.properties View File

@@ -1,4 +1,5 @@
# https://docs.mongodb.com/manual/tutorial/enable-authentication/
# bin\mongod --auth --port 27017 --dbpath "C:\Program Files\MongoDB\Server\4.2\data"
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.database=textdungeondb
spring.data.mongodb.port=27017


Loading…
Cancel
Save