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.
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 Cypher?
> This would be ideal, but min doesn't work with collections, only as an
> aggregation:
> 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.
> 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
> Cypher?
> > This would be ideal, but min doesn't work with collections, only as an
> > aggregation:
> > 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.
On Fri, Oct 5, 2012 at 7:10 AM, Wes Freeman <freeman....@gmail.com> wrote:
> 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?
>> 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
>> > Cypher?
>> > This would be ideal, but min doesn't work with collections, only as an
>> > aggregation:
>> > 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.
> On Fri, Oct 5, 2012 at 7:10 AM, Wes Freeman <freeman....@gmail.com> wrote:
>> 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?
>>> 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
>>>> Cypher?
>>>> This would be ideal, but min doesn't work with collections, only as an
>>>> aggregation:
>>>> 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.