I was wondering if there is a function to remove all uniqueness constraints of a SchemaResource
, without specifying its labels and properties keys.
It may be possible by retrieving Graph.node_labels
, then iterate through them to find SchemaResource.get_indexes()
and finally calling SchemaResource.drop_uniqueness_constraint()
for each tuple.
It may also be possible with CypherResource.execute()
and a Cypher query.
Is there another option?
There's no way to achieve this via the HTTP interface, unfortunately. The only way would be to build a server extension to carry this out and expose an endpoint for it.
If you are trying to drop the entire database, perhaps between tests, the fastest way is to delete the graph.db
directory. However, this is still problematic for two reasons - the database must be stopped and restarted either side of the deletion and there is not an HTTP endpoint for this operation either. It would still also require some form of extra software to run on the server.
You may find a few helpful extras in the py2neo server module but I'm afraid there isn't an easy answer to what you're asking.