Closed iva-bashmat closed 1 year ago
There is a way to retrieve dynamic labels for a node, but no way to create method to search by them. Check following example:
Node:
@Node("Port") public class Port { @Id private Long id; private String code; @DynamicLabels private List<String> labels; }
Repository:
public interface PortRepository extends Neo4jRepository<Port, Long> { List<Port> findByLabelsContaining(String label); }
Actual query:
MATCH (port:`Port`) WHERE $label IN port.labels RETURN port{.code, .id, __nodeLabels__: labels(port), __internalNeo4jId__: id(port)}
Expected query:
MATCH (port:`Port`) WHERE $label IN labels(port) RETURN port{.code, .id, __nodeLabels__: labels(port), __internalNeo4jId__: id(port)}
Good point, thanks for raising it.
Thanks a lot!
There is a way to retrieve dynamic labels for a node, but no way to create method to search by them. Check following example:
Node:
Repository:
Actual query:
Expected query: