Greetings,
Let's assume we have a node with a label called A
MATCH (a: A) RETURN a;
which returns one node with those properties:
{
prop1: "value1",
prop2: "value2",
prop3: "value3",
prop4: "value4"
}
The node can have n properties, but for the sake of simplicity, let's say we have 4 properties, as listed here.
Is there a way to write a Cypher query that I can get this node without a specific property? For example, I don't want to get property prop4 in the resulting node from the return statement of the query (we are talking about the same node).
I know there is a way to access those properties and send them to the server
MATCH (a:A) RETURN a.prop1, a.prop2, a.prop3
but, as you can imagine, if there were more properties, it would be a rather long query to disregard just one property in the result. Imagine if there were 50 properties and I want to exclude one of them in the result, so I have to write 49 properties in one query, which I don't think is the right way.
So, I would like to set a collection of properties that will return the node with those properties, excluding other properties that it has (like to get a subset of properties from the node) in the result (not affecting the match). How can I achieve this?
The result I would like to get from said query is
{
prop1: "value1",
prop2: "value2",
prop3: "value3"
}
with prop4 excluded!
Thanks in advance!