graph - 如何使这种类型的数据成为neo4j中的一个节点?
问题描述
我想从 json 数据在 neo4j 中创建一个节点,以用户名(唯一)命名,并具有 created_time(int) 和 info(a list) 作为专有
{
"ProfileInfo": {
"created_time": 1286323200,
"info": {
"biography": "",
"followers_count": 5000,
"following_count": 1000,
"full_name": "alpha beta",
"id": 123456789,
"is_business_account": true,
"is_joined_recently": false,
"is_private": false,
"posts_count": 1,
},
"username": "alphabeta"
}
}
我试图在密码中运行这个命令:
Call apoc.load.json("file:/Neo4j/data/alpha_sample.json") YIELD value AS user
MERGE (u:USER {username:user.ProfileInfo.username})
SET u.created_time = user.ProfileInfo.created_time,
u.info = user.ProfileInfo.info
但我得到这个错误,
Property values can only be of primitive types or arrays thereof
有谁知道我该怎么做?欢迎任何帮助
解决方案
您需要提取 ProfileInfo.username 中的每个元素。这样的事情有帮助吗?
CALL apoc.load.json("file:/Neo4j/data/alpha_sample.json") YIELD value AS user
MERGE (u:USER {username:user.ProfileInfo.username})
SET u.created_time = user.ProfileInfo.created_time,
u += user.ProfileInfo.info
推荐阅读
- python - Pandas 减去两个数据框元素的值
- excel - 检索 PPT 对象链接的名称 - VBA
- python - Python 列表分配 - 概念问题
- java - 选择名字和多查询时仅插入 ID
- parallel-processing - 裸机(==无操作系统)系统是否有任何 MCAPI API 实现?
- powershell - 从 SQL 服务器获取价值并删除相关文件夹
- javascript - 使用 Angular Material DataTable 时,Angular 组件的 ngOnInit 内的 SetTimeOut 函数
- angular - 为什么这适用于 HTTP 而不是 HTTPClient?
- accord.net - Accord .NET 中的 BagOfVisualWords
- xpages - 如何向 XPages 控件添加不带标签的属性?