Neo4j 嵌入式 DROP INDEX 抛出奇怪的错误

Neo4j embedded DROP INDEX throws odd error

设置

CREATE INDEX index_2384723 IF NOT EXISTS FOR (n:Movie) ON (n.title) 

运行

call db.indexes() yield name, labelsOrTypes
where labelsOrTypes = ["Movie"]
DROP INDEX name IF EXISTS
RETURN name

预期

要删除名称为 index_2384723 的索引 和一个 return 值:

index_2384723

现实

Invalid input 'R': expected 'e/E' (line 3, column 2 (offset: 77))
"DROP INDEX name IF EXISTS"
  ^

但是为什么呢?这是一个 neo4j 密码解析错误还是我这边的错误? 我不明白...

独立查询有效

call db.indexes() yield name, labelsOrTypes
where labelsOrTypes = ["Movie"]
RETURN name

这行得通。 和

DROP INDEX index_2384723 IF EXISTS

这也行...

无法使用密码获取索引。 db.indexes() 返回的名称是索引的值字符串(或名称)而不是索引本身。您可以按照以下步骤将其删除。

1. List the index (or indices) that you want to remove

   call db.indexes() yield name, labelsOrTypes 
   WITH name, labelsOrTypes where ANY (lbl in ['Movie',  'Person'] WHERE lbl in labelsOrTypes)
   RETURN name, labelsOrTypes

2. Pick the index (or indices) that you want to delete and copy/paste in neo4j browser

   DROP INDEX index_2384723 IF EXISTS;
   DROP INDEX index_Person IF EXISTS;

 3. Execute and verify

   Removed 1 index, completed after 4 ms.