Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Cypher: minimum collection value
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Wes Freeman  
View profile  
 More options Oct 4 2012, 5:42 pm
From: Wes Freeman <freeman....@gmail.com>
Date: Thu, 4 Oct 2012 17:42:33 -0400
Local: Thurs, Oct 4 2012 5:42 pm
Subject: Cypher: minimum collection value

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Oct 5 2012, 12:25 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Fri, 5 Oct 2012 06:24:45 +0200
Local: Fri, Oct 5 2012 12:24 am
Subject: Re: [Neo4j] Cypher: minimum collection value
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wes Freeman  
View profile  
 More options Oct 5 2012, 1:10 am
From: Wes Freeman <freeman....@gmail.com>
Date: Fri, 5 Oct 2012 01:10:30 -0400
Local: Fri, Oct 5 2012 1:10 am
Subject: Re: [Neo4j] Cypher: minimum collection value

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 <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Oct 5 2012, 8:48 am
From: Peter Neubauer <peter.neuba...@neotechnology.com>
Date: Fri, 5 Oct 2012 14:48:22 +0200
Local: Fri, Oct 5 2012 8:48 am
Subject: Re: [Neo4j] Cypher: minimum collection value
Yeah,
maybe that coudl be expressed in ORDER BY?

start n=node(0)
with [3,2,1,4,5] as coll
return coll order by elements(coll) asc;

or so?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Oct 5 2012, 11:59 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Sat, 6 Oct 2012 05:59:24 +0200
Local: Fri, Oct 5 2012 11:59 pm
Subject: Re: [Neo4j] Cypher: minimum collection value
I somehow see that we duplicate a lot of functionality that is available for aggregation/order by/skip limit
in working with collections.

It would be great if we could find a way of merging the two?

Perhaps it is really time to look into subqueries? Aka cypher queries on collections?
Don't know if it makes sense or not.

> start n=node(0)
   match n--m
> with collect(m) as coll

   return (
               start x in coll // or start x = coll
               where x.foo > 5
               return x.name
               order by x.age desc
               limit 2
               )

could perhaps be simplified to when only returning x

   return (
               x in coll // or  x = coll
               where x.foo > 5
               order by x.age desc
               limit 2
               )

Am 05.10.2012 um 14:48 schrieb Peter Neubauer:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »