neo4j-javascript-driver icon indicating copy to clipboard operation
neo4j-javascript-driver copied to clipboard

neo4j-driver does not perform collect operation correctly

Open IR-Baboon opened this issue 3 years ago • 1 comments

Hello there!

I am working on an application and i stumbled across something. When i perform the following query, i get weird results. This is my setup right now.

  • Neo4j version: Enterprise 4.10
  • Neo4j Mode: Single instance
  • Driver version: 4.4.7 neo4j-driver
  • Operating system: windows
  • Steps to reproduce
  • query to instantate the data without props:
CREATE (ML:Messagelist {id:1})
CREATE (:User)<-[:MEMBER]-(ML)
CREATE (:User)<-[:MEMBER]-(ML)

query to match the members:

      MATCH (ML:Messagelist {id:1})
      MATCH (ML)-[:MEMBER]->(member:User)
      RETURN ML as chat, collect(member) as members

When i run this in the browser, i get following result: image

But when i perform the same query in the driver, i get the following:

[
  Record {
    keys: [ 'chat', 'members' ],
    length: 2,
    _fields: [ [Node], [Array] ],
    _fieldLookup: { chat: 0, members: 1 }
  }
]
[
  {
    identifier: 'Messagelist',
    createdAt: '2022-08-15T12:52:58.585Z',
    id: '61fad94e-3df6-4fcb-b81b-3fad13c84ddb',
    updatedAt: '2022-08-18T09:48:39.516Z'
  }
]
[ undefined ]

the driver returns [undefined] for the collect. Is this a bug or am i just blatantly doing something wrong?

IR-Baboon avatar Aug 18 '22 10:08 IR-Baboon

Hi @lexcomesdev, could you please share the code which printed the result you share?

bigmontz avatar Sep 06 '22 13:09 bigmontz

Close due inactivity. Please, re-open with the sample coded for reproducing the issue.

bigmontz avatar Jan 31 '24 09:01 bigmontz