在Neo4j中存儲圖像(二進制數組)的最佳方式是什麼? 我將它們存儲爲二進制數組,但是如何使用Cypher查詢來檢索它們? 我有這個查詢,其中圖片已被存儲爲二進制數組,但它似乎有一個例外。Neo4j - 使用密碼查詢存儲和檢索圖像
Match (n:`employees`) where employeeid='1' return n.picture
這是一個完整的堆棧跟蹤:(圖像大小爲12KB)
org.neo4j.rest.graphdb.RestResultException: Unhandled array type: class [B at
UnsupportedOperationException
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatchArray(PropertyTypeDispatcher.java:720)
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatchNumberArray(PropertyTypeDispatcher.java:715)
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatchByteArrayProperty(PropertyTypeDispatcher.java:675)
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatchByteArrayProperty(PropertyTypeDispatcher.java:280)
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatchPrimitiveArray(PropertyTypeDispatcher.java:135)
org.neo4j.server.helpers.PropertyTypeDispatcher.dispatch(PropertyTypeDispatcher.java:122)
org.neo4j.server.rest.repr.CypherResultRepresentation.getRepresentation(CypherResultRepresentation.java:185)
org.neo4j.server.rest.repr.CypherResultRepresentation.access$000(CypherResultRepresentation.java:38)
org.neo4j.server.rest.repr.CypherResultRepresentation$2$1.underlyingObjectToObject(CypherResultRepresentation.java:103)
org.neo4j.server.rest.repr.CypherResultRepresentation$2$1.underlyingObjectToObject(CypherResultRepresentation.java:99)
org.neo4j.helpers.collection.IterableWrapper$MyIteratorWrapper.underlyingObjectToObject(IterableWrapper.java:57)
org.neo4j.helpers.collection.IteratorWrapper.next(IteratorWrapper.java:47)
org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:64)
org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)
org.neo4j.server.rest.repr.ListSerializer.addList(ListSerializer.java:56)
org.neo4j.server.rest.repr.ListRepresentation.addTo(ListRepresentation.java:79)
org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:65)
org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)
org.neo4j.server.rest.repr.MappingSerializer.putList(MappingSerializer.java:61)
org.neo4j.server.rest.repr.CypherResultRepresentation.serialize(CypherResultRepresentation.java:83)
org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:41)
org.neo4j.server.rest.repr.OutputFormat$1.write(OutputFormat.java:160)
org.neo4j.server.rest.security.SecurityFilter.doFilter(SecurityFilter.java:112)
java.lang.Thread.run(Unknown Source)
您可以嘗試使用事務端點嗎?也許用neo4j-jdbc驅動程序?或者通過捲曲直接測試它?這個問題是Neo4j-Server中的一個錯誤。你可以在github上提出它,但它已經過時了,所以我不確定這是值得修復的。 –