As the error messages says, expressions in WITH have to be named, sorry my bad.

> MATCH (n:Label)
> WITH n.uniqueId as ID, collect(n) as nodes
> WHERE size(nodes) > 1
> FOREACH (n in tail(nodes) | DELETE n)

> Am 27.02.2015 um 18:08 schrieb Gallagher Polyn <[email protected]>:
> 
> MATCH (n:Label)
> WITH n.uniqueId, collect(n) as nodes
> WHERE size(nodes) > 1
> FOREACH (n in tail(nodes) | DELETE n)
>> I'd like to use Cypher to remove all duplicate nodes, where my basis for 
>> determining duplication would be comparing one field, namely, 
>> 'some-unique-id'. 
>> 
>> How can I accomplish the above with Cypher?
> 
> 
>  Thanks Michael, but in 2.1.6 your suggestion, adapted below, fails...
> 
> MATCH (n:Input)
> WITH n.inputID, collect(n) AS nodes
> WHERE size(nodes) > 1
> FOREACH (n in tail(nodes) | DELETE n);
> Expression in WITH must be aliased (use AS) (line 2, column 6)
> "WITH n.inputID, collect(n) AS nodes"
>       ^
> 
> I have reviewed neo4j.com/docs/stable/query-with.html, but am unable to 
> extend from those examples to this case.
> 
> Please advise, if possible.
> 
> G
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to