I thought of that too, but node re-use kills that approach, if the server
ever gets stopped/started.


-----Original Message-----
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
Behalf Of Craig Taverner
Sent: Friday, March 04, 2011 9:16 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Load last 10 created nodes from neo4j

What about taking the id of the last node created, and just decrementing
backwards by 1, ten times, and get those ten nodes? This will not take into
account id-reuse, though, so if you have node deletion, this will not
necessarily give the last ten added, only the ten with highest id. I expect
that quite often it will be the same thing, though. Depending on what you
need this for, perhaps this is good enough?

On Fri, Mar 4, 2011 at 2:59 PM, Rick Bullotta <
rick.bullo...@burningskysoftware.com> wrote:

> It would be pretty easy to use an index to do this (keep only the 10 most
> recent in the index), but you'd need to implement code everywhere you
> add/delete nodes and relationships, and if you're using an abstraction
> layer, it wouldn't be possible.
>
> In short, it's absolutely possible, but you'll need to implement it in
your
> code.
>
> -----Original Message-----
> From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
> On
> Behalf Of mike_t
> Sent: Friday, March 04, 2011 8:54 AM
> To: user@lists.neo4j.org
> Subject: [Neo4j] Load last 10 created nodes from neo4j
>
> Hi, is it possible to load for example the last 10 created nodes or
> relationships from the neo4j db?
>
> I know it is not the normal use case for a graph db but however i need a
> solution.
>
> Thanks for your answers,
>
> Mike
>
> --
> View this message in context:
>
>
http://neo4j-user-list.438527.n3.nabble.com/Load-last-10-created-nodes-from-
> neo4j-tp2633139p2633139.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

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

Reply via email to