neo4j | Desktop数据导出&APOC


在这里插入图片描述

问题描述

需要把neo4j中创建好的本体(结点和关系)导出至json格式,运行如下代码时出错。
备注:neo4j桌面版j和apoc plugin版本都是5.20.0。

CALL apoc.export.json.all("yes.json")

第一个遇到的问题

Failed to invoke procedure: Caused by: java.lang.RuntimeException: Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf. 
Otherwise, if you are running in a cloud environment without filesystem access, use the {stream:true} config and null as a 'file' parameter to stream the export back to your client.
Note that the stream mode cannot be used with the apoc.export.xls.* procedures.

参考该老师的方法,采取了如下措施:修改setting中的内容。
在这里插入图片描述
在这里插入图片描述

dbms.security.procedures.unrestricted=apoc.*
dbms.security.procedures.allowlist=apoc.*

满怀信心,觉得又没问题了,结果又遇到了第二个问题。
中间还遇到一个问题,桌面版是没有apoc.conf的,不要被apoc官方文档骗了,就算你自己创建了并添加apoc.export.file.enabled=true apoc.import…file.enabled=true也是没用的。(雷中雷)加到DBMS的setting会直接导致数据库无法启动!!!!!(社区版不确定,请注意看版本叭)

第二个遇到的问题

Failed to invoke procedure `apoc.export.json.all`: Caused by: org.apache.commons.configuration2.ex.ConversionException: Key 'apoc.export.file.enabled' cannot be converted to class java.lang.Boolean. Value is: '[true, true]'.

在这里插入图片描述
啊啊啊啊!!!!崩溃状态!!
注意了!!!还是setting的问题,
请把setting改成这样:
在这里插入图片描述
其中1是apoc安装以后系统自带的,我之前给它注释掉了,加了2和3报错如问题二。所以解决方案其实就是默认的1不要动,没有就加上;然后加上3,问题就解决了!!
成功了!!!

第三个问题

重新建立了一个project,我也按照第二个问题的解决方式做了,然后如下:
在这里插入图片描述

但是依旧报错,让我去改apoc.conf,青天大老爷,你告诉我哪里找。仔细对比了下之前能导出的那个project,盲生我发现了华点。
在这里插入图片描述

终极解决方案,请直接复制

dbms.security.procedures.unrestricted=jwt.security.*,apoc.*,gds.*
dbms.security.procedures.allowlist=apoc.*

总结

值得做的:遇事不决,多看看setting!!!
不要做的:
不要加奇奇怪怪的东西,请参考问题一末尾
官方语法以及说明这里

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值