neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript

Home Page:https://neo4j.com/docs/javascript-manual/current/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

neo4j-driver does not perform collect operation correctly

IR-Baboon opened this issue · 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?

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

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