#136 ✓resolved
Andreas Ronge

support for has_list - ordered list of items

Reported by Andreas Ronge | November 17th, 2010 @ 02:33 PM | in 1.0.0.beta.21

Would be nice to have (like in 0.4.6) support for lists.
I think we can use http://api.neo4j.org/current/org/neo4j/index/timeline/Timeline.html

API Example, without timeline index

  class Person 
    include Neo4j::NodeMixin
    has_list :tweets
  end

  person = Person.new
  person.tweets << tweet_1 << tweet_2

  person.tweets # => [tweet_1, tweet_2] in the order it was inserted

Example with timeline index

class Person 
  include Neo4j::NodeMixin
  has_list :tweets
end

person = Person.new
person.tweets[ Time.utc(value.year, value.month, value.day).to_i ] = tweet_1  # use any fixnum as index
person.tweets[ Time.utc(value.year, value.month, value.day).to_i ] = tweet_2

person.tweets.between(5313..136136)
person.tweets #=> all tweets

Size

It should a directly calculate the size of the list without traversing all items

  person.tweets.size

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket

Referenced by

Pages