neo4j / neo4j-dotnet-driver

Neo4j Bolt driver for .NET
Apache License 2.0
226 stars 69 forks source link

Cypher is working from the web interface but not with neo4j-dotnet? #732

Closed Thypari closed 11 months ago

Thypari commented 11 months ago

Describe the bug When running the cypher from the web interface it concludes with no error and returns the expected results. But when running it from neo4j-dotnet it concludes with an error. Below you find the query.log from both:

Version Info:

query log web interface

2023-09-22 17:15:36.304+0000 INFO  Query started: id:15667 - 0 ms: 0 B - bolt-session bolt neo4j-browser/v4.4.5 client/0:0:0:0:0:0:0:1:57580 server/0:0:0:0:0:0:0:1:7687> graph.db - neo4jAdmin - match
                (:Workflow {guid:"a9550ce6-095e-4fa5-b894-2ec66b626876"})<-[:rel_logBook_source]-(logBookEntry:LogBookEntry)-[:rel_logBook_transaction]->(:BusinessTransaction {type:'AdGroupMember'}),
                (logBookEntry)-[:rel_logBook_adGroup]->(adGroup:ADAccount)
            with
                logBookEntry, adGroup
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountAdded]->(account)
            WITH logBookEntry,
                 adGroup,
                 COLLECT(DISTINCT CASE
                                     WHEN account.name <> "" THEN account.name
                                     ELSE account.objectSID
                                  END) AS addedAdAccounts
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountRemoved]->(account)
            RETURN adGroup.name AS groupName,
                   addedAdAccounts,
                   COLLECT(DISTINCT CASE
                                       WHEN account.name <> "" THEN account.name
                                       ELSE account.objectSID
                                    END) AS removedAdAccounts - {} - runtime=null - {type: 'user-direct', app: 'neo4j-browser_v4.4.5'}
2023-09-22 17:15:36.318+0000 INFO  id:15667 - 14 ms: 3584 B - bolt-session bolt neo4j-browser/v4.4.5 client/0:0:0:0:0:0:0:1:57580 server/0:0:0:0:0:0:0:1:7687> graph.db - neo4jAdmin - match
                (:Workflow {guid:"a9550ce6-095e-4fa5-b894-2ec66b626876"})<-[:rel_logBook_source]-(logBookEntry:LogBookEntry)-[:rel_logBook_transaction]->(:BusinessTransaction {type:'AdGroupMember'}),
                (logBookEntry)-[:rel_logBook_adGroup]->(adGroup:ADAccount)
            with
                logBookEntry, adGroup
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountAdded]->(account)
            WITH logBookEntry,
                 adGroup,
                 COLLECT(DISTINCT CASE
                                     WHEN account.name <> "" THEN account.name
                                     ELSE account.objectSID
                                  END) AS addedAdAccounts
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountRemoved]->(account)
            RETURN adGroup.name AS groupName,
                   addedAdAccounts,
                   COLLECT(DISTINCT CASE
                                       WHEN account.name <> "" THEN account.name
                                       ELSE account.objectSID
                                    END) AS removedAdAccounts - {} - runtime=pipelined - {type: 'user-direct', app: 'neo4j-browser_v4.4.5'}

query log neo4j-dotnet

2023-09-22 17:14:14.607+0000 ERROR id:15650 - 2 ms: 0 B - bolt-session bolt neo4j-dotnet/4.4 client/10.242.2.5:58372 server/10.242.2.5:7687> <none> - neo4jAdmin - match
                (:Workflow {guid:$workflowGuid})<-[:rel_logBook_source]-(logBookEntry:LogBookEntry)-[:rel_logBook_transaction]->(:BusinessTransaction {type:'AdGroupMember'}),
                (logBookEntry)-[:rel_logBook_adGroup]->(adGroup:ADAccount)
            with
                logBookEntry, adGroup
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountAdded]->(account)
            WITH logBookEntry,
                 adGroup,
                 COLLECT(DISTINCT CASE
                                     WHEN account.name <> " THEN account.name
                                     ELSE account.objectSID
                                  END) AS addedAdAccounts
            OPTIONAL MATCH (logBookEntry)-[:rel_logBook_adAccountRemoved]->(account)
            RETURN adGroup.name AS groupName,
                   addedAdAccounts,
                   COLLECT(DISTINCT CASE
                                       WHEN account.name <> " THEN account.name
                                       ELSE account.objectSID
                                    END) AS removedAdAccounts - {workflowGuid: 'a9550ce6-095e-4fa5-b894-2ec66b626876'} - runtime=null - {} - Query cannot conclude with WITH (must be a RETURN clause, an update clause, a unit subquery call, or a procedure call with no YIELD) (line 7, column 13 (offset: 413))
Thypari commented 11 months ago

I just realized that there was an issue with the quotes characters. I will see if fixing the quotes will resolve all issues.

EDIT: It was indeed the quotes. What looked like a pair of single quotes was just 1 double quote character....