如何将地图或json对象存储为neo4j中的属性? [英] How to store a map or json object as a property in neo4j?

查看:290
本文介绍了如何将地图或json对象存储为neo4j中的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将地图或json对象存储为Neo4j中的属性,但是它不起作用.

I'm trying store a map or json object as a property in Neo4j, but it doesn't work.

推荐答案

现在这是节点属性的限制.您可以选择几种解决方法.

That's a limitation of node properties right now. You have a few workarounds to choose from.

  1. 您可以将json对象转换为字符串并将其另存为属性.您可以使用 APOC程序在JSON字符串与Cypher映射之间进行转换对象.

  1. You can turn your json object into a string and save it as a property. You can use APOC Procedures to convert JSON strings to and from Cypher map objects.

您可以将地图属性另存为节点上的属性,尽管这样会丢失从对象本身获得的分组.

You can instead save the map properties as properties on the node, though that loses the grouping you would get from the object itself.

如果#2还不够,您还可以更改图形模型,以便JSON对象中的数据对应于图形对象,节点以及与原始节点相关的属性.

If #2 isn't enough, you could also alter your graph model so the data in the JSON object corresponds to graph objects, nodes and properties related to the original node.

这篇关于如何将地图或json对象存储为neo4j中的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆