I was trying to query my node Person by its internal ID and the code of its City like this:
Optional<Person> findByIdAndCityCode(Long id, String cityCode);
but the generated query behind this tries to access the ID as a property, like this:
MATCH (n:`Person`)-[r_1:`LOCATED_IN`]->(m_1:`City`) WHERE (n.id= $0 AND m_1.code = $1) RETURN n
instead of going for
id(n)=$0, which is what I need in this scenario.
How can I solve this issue without writing a custom query for every such case where I have to search by the internal ID and another property?
findById works just find by its own, but when trying to add more properties to the query it gets weird.
Should I consider adding another id field that I can query on?