On Mon, Jan 23, 2012 at 4:40 AM, John Howard <johnyho...@gmail.com> wrote:

> Hello,
>
> I am trying to get distict property values on a list of nodes.
> The property value is an array in graph. Example:
> node1.color = [red]
> node2.color=[red]
> node3.color=[green]
> node4.color=[yellow]
> node5.color=[red]
>
> My cypher query:
> START n=node:index(type="sometype")
> RETURN distinct n.color,count(*)
>
> it returns
> [red]
> [red]
> [green]
> [yellow]
> [red]
>
> Shouldn't it just return 3 unique colors?
>

This is not what happens when I try it here:


   - neo4j-sh (0)$ start n=node(0,1,2,3,4) return distinct n.color, count(*)
   - ==> +---------------------+
   - ==> | n.color  | count(*) |
   - ==> +---------------------+
   - ==> | "red"    | 3        |
   - ==> | "green"  | 1        |
   - ==> | "yellow" | 1        |
   - ==> +---------------------+
   - ==> 3 rows, 3 ms


How are you running your tests? How are you inserting data?

Andrés
_______________________________________________
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to