GRAPH.CONSTRAINT DROP
syntax: | GRAPH.CONSTRAINT DROP key MANDATORY|UNIQUE NODE label | RELATIONSHIP reltype PROPERTIES propCount prop [prop…]
—
Deleted a graph constraint.
For an introduction to constraints see GRAPH.CONSTRAINT CREATE
Required arguments
key
is key name for the graph. constraintType
is the constraint type: either `MANDATORY` or `UNIQUE`. NODE label | RELATIONSHIP reltype
is the graph entity type (`NODE` or `RELATIONSHIP`) and the name of the node label or relationship type on which the constraint is enforced. propCount
is the number of properties following. Valid values are between 1 and 255. prop...
is a list of `propCount` property names. Return value
@simple-string-reply - OK
if executed correctly, or @error-reply otherwise.
Examples
To delete a unique constraint for all nodes with label Person
enforcing uniqueness on the combination of values of attributes first_name
and last_name
, issue the following command:
from falkordb import FalkorDB
client = FalkorDB()
result = client.drop_constraint('g', 'UNIQUE', 'NODE', 'Person', ['first_name', 'last_name'])
print(result)
import { FalkorDB } from 'falkordb';
const client = await FalkorDB.connect();
const result = await client.dropConstraint('g', 'UNIQUE', 'NODE', 'Person', ['first_name', 'last_name']);
console.log(result);
let client = FalkorDB::connect_default();
let result = client.drop_constraint("g", "UNIQUE", "NODE", "Person", &["first_name", "last_name"])?;
println!("{}", result);
FalkorDB client = new FalkorDB();
String result = client.dropConstraint("g", "UNIQUE", "NODE", "Person", Arrays.asList("first_name", "last_name"));
System.out.println(result);
redis> GRAPH.CONSTRAINT DROP g UNIQUE NODE Person PROPERTIES 2 first_name last_name
# Output: OK