Received: by 10.42.132.5 with SMTP id b5mr4419775ict.7.1349413853501; Thu, 04 Oct 2012 22:10:53 -0700 (PDT) X-BeenThere: neo4j@googlegroups.com Received: by 10.42.84.2 with SMTP id j2ls7911019icl.0.gmail; Thu, 04 Oct 2012 22:10:50 -0700 (PDT) Received: by 10.42.21.195 with SMTP id l3mr4473632icb.14.1349413850933; Thu, 04 Oct 2012 22:10:50 -0700 (PDT) Received: by 10.42.21.195 with SMTP id l3mr4473629icb.14.1349413850919; Thu, 04 Oct 2012 22:10:50 -0700 (PDT) Return-Path: Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by gmr-mx.google.com with ESMTPS id dd6si25129igc.0.2012.10.04.22.10.50 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Oct 2012 22:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of freeman....@gmail.com designates 209.85.214.178 as permitted sender) client-ip=209.85.214.178; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of freeman....@gmail.com designates 209.85.214.178 as permitted sender) smtp.mail=freeman....@gmail.com; dkim=pass header...@gmail.com Received: by mail-ob0-f178.google.com with SMTP id tb18so1633641obb.37 for ; Thu, 04 Oct 2012 22:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=2xKnHMNvVxRPtjqorKxYft1K7K1b0+3cRYPxi6UyGiE=; b=Jljm2cTNfnupkrwNOKhnaeDVo3xWdP2M9ifFRUDGIQbbciciN6fJyIu9YjyY3Y+ypF XVzPqnu35pS85Ups6I2lUc5T8gseL7EPpCPHoWfHmsv+4ZJX0iNz/h0iYsjcbMXY4Fw+ F1hBB41LGrdIbag02BUN9jIvSEn4QWSOtNRNp72k5vxUn7iwlqpG3f13QB+rAv8eTNny JStTWhfsPc1TCzYS6ekl93T4ECMO7dMBMCBlDNHLb7L4apnOrT5J8EsbF0X98t4l0kKw 7syx5CemFqMffXADxkk3ZibPO7ZP/+1rIS8ahCjazIwWjHhTzaaWRKuUG/T0vsQCsvb/ 8FJA== Received: by 10.60.23.161 with SMTP id n1mr6360420oef.67.1349413850524; Thu, 04 Oct 2012 22:10:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.139.138 with HTTP; Thu, 4 Oct 2012 22:10:30 -0700 (PDT) In-Reply-To: References: From: Wes Freeman Date: Fri, 5 Oct 2012 01:10:30 -0400 Message-ID: Subject: Re: [Neo4j] Cypher: minimum collection value To: neo4j@googlegroups.com Content-Type: multipart/alternative; boundary=e89a8fb1f92a372b3004cb48e5a2 --e89a8fb1f92a372b3004cb48e5a2 Content-Type: text/plain; charset=UTF-8 Maybe, but I couldn't come up with a way of doing it without conditional expressions inside the reduce. Wes On Fri, Oct 5, 2012 at 12:24 AM, Peter Neubauer < peter.neuba...@neotechnology.com> wrote: > Mmh, > would this be doable with your REDUCE somehow, using a MIN in there? > > Cheers, > > /peter neubauer > > G: neubauer.peter > S: peter.neubauer > P: +46 704 106975 > L: http://www.linkedin.com/in/neubauer > T: @peterneubauer > > Neo4j 1.8 GA - > http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html > > > On Thu, Oct 4, 2012 at 11:42 PM, Wes Freeman > wrote: > > Does anyone have a way to find the minimum value in a collection in > Cypher? > > > > This would be ideal, but min doesn't work with collections, only as an > > aggregation: > > > > start n=node(0) > > with [3,2,1,4,5] as coll > > return min(coll); > > ----------- > > |min(coll)| > > ----------- > > |1 | > > ----------- > > > > I couldn't figure out a way to do it without conditional > expressions--hoping > > for a clever solution using existing Cypher commands. Seems like you can > > almost do it with filter. Maybe a way to sort collections based on a > > property would be handy for this kind of thing. > > > > Thanks, > > Wes > > > > -- > > > > > > -- > > > --e89a8fb1f92a372b3004cb48e5a2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Maybe, but I couldn't come up with a way of doing it without conditiona= l expressions inside the reduce.=C2=A0

Wes

On Fri, Oct 5, 2012 at 12:24 AM, Peter Neubauer <peter.neuba...@neotechnology.com> wrote:
Mmh,
would this be doable with your REDUCE somehow, using a MIN in there?

Cheers,

/peter neubauer

G: =C2=A0neubauer.peter
S: =C2=A0peter.neubauer
P: =C2=A0+46 70= 4 106975
L: =C2=A0 http://www.linkedin.com/in/neubauer
T: =C2=A0 @peterneubauer

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_1= 8_release_fluent_graph_literacy.html


On Thu, Oct 4, 2012 at 11:42 PM, Wes Freeman <freeman....@gmail.com> wrote:
> Does anyone have a way to find the minimum value in a collection in Cy= pher?
>
> This would be ideal, but min doesn't work with collections, only a= s an
> aggregation:
>
> start n=3Dnode(0)
> with [3,2,1,4,5] as coll
> return min(coll);
> -----------
> |min(coll)|
> -----------
> |1 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
> -----------
>
> I couldn't figure out a way to do it without conditional expressio= ns--hoping
> for a clever solution using existing Cypher commands. Seems like you c= an
> almost do it with filter. Maybe a way to sort collections based on a > property would be handy for this kind of thing.
>
> Thanks,
> Wes
>
> --
>
>

--



--e89a8fb1f92a372b3004cb48e5a2--