# I can't use IgnoreCase in Neo4JRepositories

**URL:** <https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Created:** [March 4, 2020, 10:46am UTC](https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326 "2020-03-04T10:46:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ultrayano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ultrayano/32/9548_2.png) [@Ultrayano](https://community.neo4j.com/u/Ultrayano)\
**Post date:** [March 4, 2020, 10:46am UTC](https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326/1 "2020-03-04T10:46:54Z")

</div>

We'd like to use case insensitivity searches in our project with the help of Neo4JRepositories, but we don't have the option to do so. The feature should be in SDN since version 5.2.0.M2 (2019-03-07). We're using version 5.2.5.RELEASE as of now.

We'd like to use it like this:

```auto
@Repository
interface LocationsRepository extends Neo4jRepository<Location, String> {
    List<Location> findByNameIgnoreCase(String location);
}

```

but are currently using a workaround with regex.

---

<div class="post-metadata">

**Author:** ![gerrit.meier](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gerrit.meier/32/27374_2.png) [@gerrit.meier](https://community.neo4j.com/u/gerrit.meier)\
**Post date:** [March 4, 2020, 12:25pm UTC](https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326/2 "2020-03-04T12:25:03Z")

</div>

I just ensured with exactly this version that it generates the right query like  
`MATCH (n:Location) WHERE toLower(n.name) = toLower($location) RETURN ... `  
Could you turn debug logging on for `org.neo4j.ogm` and look what query do you get generated when executing the method above?

---

<div class="post-metadata">

**Author:** ![Ultrayano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ultrayano/32/9548_2.png) [@Ultrayano](https://community.neo4j.com/u/Ultrayano)\
**Post date:** [March 4, 2020, 12:53pm UTC](https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326/3 "2020-03-04T12:53:42Z")

</div>

It works! But it seems like IntelliJ has no auto-completion for the IgnoreCase in findBy.. **IgnoreCase**.

Another question. Is it possible to make a query with startsWith?  
findByNameIsStartingWithIgnoreCase(String string) doesn't seem to work.

```auto
Unable to ignore case of java.lang.String types, the property 'name' must reference a String

```

---

<div class="post-metadata">

**Author:** ![gerrit.meier](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gerrit.meier/32/27374_2.png) [@gerrit.meier](https://community.neo4j.com/u/gerrit.meier)\
**Post date:** [March 6, 2020, 10:30am UTC](https://community.neo4j.com/t/i-cant-use-ignorecase-in-neo4jrepositories/15326/4 "2020-03-06T10:30:00Z")

</div>

This is not yet supported but we think it should.  
There is now a [ticket](https://jira.spring.io/browse/DATAGRAPH-1301) that is also kind of already solved but we also need to release new service versions of Neo4j-OGM 3.1 and 3.2 to make this work throughout the stack.
