Reputation: 825
Is it possible to remove or set a label and property in the same query, what are the rules?
MATCH (n { name: 'Peter' })
REMOVE n:German:Student n.address
RETURN n
or does it even cascade further
MATCH (n { name: 'Peter' })
REMOVE n:German:Student.address
RETURN n
as well as
MATCH (n { name: 'Peter' })
REMOVE n.address:Student:German
RETURN n
and
MATCH (n { name: 'Peter' })
REMOVE n.address.name.size
RETURN n
The Set queries would look pretty much the same
Upvotes: 2
Views: 456
Reputation: 18002
You can have more than one REMOVE
clause, so yes you can do both in one query, like this:
CREATE (f:Foo { bar: 1 });
MATCH (f:Foo)
REMOVE f:Foo /* Remove label */
REMOVE f.bar /* Remove property */
RETURN f; /* Return empty node */
Upvotes: 4