Skip to content

Search by @DynamicLabels #2638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iva-bashmat opened this issue Dec 5, 2022 · 2 comments
Closed

Search by @DynamicLabels #2638

iva-bashmat opened this issue Dec 5, 2022 · 2 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@iva-bashmat
Copy link

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)}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 5, 2022
@michael-simons michael-simons added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 14, 2022
@michael-simons michael-simons self-assigned this Dec 14, 2022
@michael-simons
Copy link
Collaborator

Good point, thanks for raising it.

michael-simons added a commit that referenced this issue Dec 14, 2022
michael-simons added a commit that referenced this issue Dec 14, 2022
@iva-bashmat
Copy link
Author

Thanks a lot!

@michael-simons michael-simons mentioned this issue Jan 4, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants