cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Excercise-14.3 Creating Index shows already it is available. But when I drop it, it says there is no index. DO others face the same issue?

Isha
Node Clone

5 REPLIES 5

Hello @Isha

I never did this exercice but I think I can help:

  • to list indexes: SHOW INDEXES
  • to delete the index: DROP INDEX PersonBornIndex IF EXISTS

Regards,
Cobra

Isha
Node Clone

Hi @Cobra , thanks for your reply, there is some mistake in the script, and want them to correct it.
If I try to create index, it shows the index already exists.
When I try to delete, it says index does not exist.
Like a never-ending loop..

Did you try the queries I gave you?

I tried, but it is not available in the list of indexes.

So there are two possible things that can conflict here. I believe you're hitting both of them, a different one for each case.

An index's name is unique. And the elements of the index are unique to an index.

From those error messages we can conclude that there is an index on :Person(born) (which is why you can't create it), but that it does not have the name "PersonBornIndex" (which is why you can't drop an index of that name).

To get rid of the index by what it is indexing on instead of its name, use:

DROP INDEX ON :Person(born)

or, SHOW INDEXES, find the name of the index on that label and property, and drop it using that name.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online