使用neo4j-javascript驱动程序时,节点有其他键

时间:2022-06-06 18:01:56

I'm slowly migrating my backend over to use the new javascript drivers for neo4j 3.0.3 over the bolt protocol but objects returned contain 3 properties:

我正在慢慢迁移我的后端以使用neo4j 3.0.3的新javascript驱动程序而不是bolt协议,但返回的对象包含3个属性:

{
  identity: {},
  keys: [],
  properties: {
    foo: 'bar',
    fooo: 'baar'
  }
}

I was using a simple rest client before and it would just return the properties, which is what I wanted. How do I get it do that using the javascript drivers and omit this nested structure?

之前我使用的是一个简单的rest客户端,它只返回属性,这就是我想要的。如何使用javascript驱动程序并省略此嵌套结构?

1 个解决方案

#1


1  

I've since discovered that NEO4J has a properties() method which extracts all the properties from the node.

我发现NEO4J有一个properties()方法,它从节点中提取所有属性。

MATCH (n:User)
WHERE n.name = 'bob'
RETURN properties(n)

#1


1  

I've since discovered that NEO4J has a properties() method which extracts all the properties from the node.

我发现NEO4J有一个properties()方法,它从节点中提取所有属性。

MATCH (n:User)
WHERE n.name = 'bob'
RETURN properties(n)