Py2neo - remove all schema uniqueness constraints

I was wondering if there is a function to remove all uniqueness constraints SchemaResource

without specifying its labels and property keys.

This could be possible by fetching Graph.node_labels

and then iterating through them to find SchemaResource.get_indexes()

and finally call SchemaResource.drop_uniqueness_constraint()

for each tuple.

This is also possible with CypherResource.execute()

Cypher and Query.

Is there any other option?

+3


source to share


1 answer


It is not possible to achieve this via the HTTP interface, unfortunately. The only way is to build a server extension to accomplish this and provide an endpoint for it.

If you are trying to delete the entire database, perhaps between tests, the fastest way is to delete the directory graph.db

. However, this is still problematic for two reasons: the database must be stopped and restarted on each side of the delete, and there is no HTTP endpoint for this operation either. It would also require some additional software to run on the server.



You can find some useful additions in the py2neo server module , but I'm afraid there is no simple answer to ask.

0


source







All Articles