Is there a cypher command to drop all constraints?
I know I can drop specific constraints.
DROP CONSTRAINT ON (book:Book) ASSERT book.isbn IS UNIQUE
However I want to clear all constraints as part of teardown after testing. Can't find anything in the docs, but something like:
DROP CONSTRAINT *
Update: My testing setup.
Writing a tiny promise-based nodejs cypher client. I want to test defining unique indexes in application code.
Note using APOC you can drop all indexes and constraints via CALL apoc. schema. assert({}, {}) . Nice - that's amazing and quick!
There is a method to delete a node and all relationships related to that node. Use the DETACH DELETE statement: Example: MATCH (Kohli:player{name: "Virat Kohli"}) DETACH DELETE Kohli.
Remove all properties REMOVE cannot be used to remove all existing properties from a node or relationship. Instead, using SET with = and an empty map as the right operand will clear all properties from the node or relationship.
Note using APOC you can drop all indexes and constraints via CALL apoc.schema.assert({}, {})
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With