Why the query result is inconsistent between table and graph

I have two nodes have bi-directional relationships, each has a property indicate the direction "pr2p", "p2pr". here is my query:
MATCH (pr:PractitionerRole {pr_id: '207'}) -[r:ASSOCIATED_WITH]-(p:Practitioner)
WHERE r.direction = 'pr2p' WITH pr, r, p RETURN pr, r, p
The query return table:
{
"identity": 718,
"labels": [
"PractitionerRole"
],
"properties": {
"resource": "PR",
"pr_id": "207"
},
"elementId": "4:61736de2-b72a-4015-8a30-39e1641a49b4:718"
}
{
"identity": 1161928703861588686,
"start": 718,
"end": 298,
"type": "ASSOCIATED_WITH",
"properties": {
"p_rating": "1",
"direction": "pr2p"
},
"elementId": "5:61736de2-b72a-4015-8a30-39e1641a49b4:1161928703861588686",
"startNodeElementId": "4:61736de2-b72a-4015-8a30-39e1641a49b4:718",
"endNodeElementId": "4:61736de2-b72a-4015-8a30-39e1641a49b4:298"
}
{
"identity": 298,
"labels": [
"Practitioner"
],
"properties": {
"resource": "P",
"p_name": "SETH AARON. STAMBAUGH",
"p_type": "FAMILY PRACTICE",
"p_id": "1730706219"
},
"elementId": "4:61736de2-b72a-4015-8a30-39e1641a49b4:298"
}
but the graph show: both relations.


How could I fix this. Thanks.

Your match statement dos not specify a direction, so you will get relationships in both directions if they exist.

After add direction the graph still display both.
MATCH (pr:PractitionerRole {pr_id: '207'}) -[r:ASSOCIATED_WITH]->(p:Practitioner)

WHERE r.direction = 'pr2p' WITH pr, r, p

RETURN pr, r, p

oh...the browser will show all relationships between each node displayed. this is a behavior of the browser. There is a setting to turn this off. Uncheck the "connect result nodes" checkbox in the settings of your database settings.

That worked! Thanks.