Method: Neography::Rest::RelationshipIndexes#add_relationship_to_index

Defined in:
lib/neography/rest/relationship_indexes.rb

#add_relationship_to_index(index, key, value, id, unique = false) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/neography/rest/relationship_indexes.rb', line 31

def add_relationship_to_index(index, key, value, id, unique = false)
  options = {
    :body => (
      { :uri   => @connection.configuration + "/relationship/#{get_id(id)}",
        :key   => key,
        :value => value
      }
    ).to_json,
    :headers => json_content_type
  }
  path = unique ? "/index/relationship/%{index}?unique" % {:index => index} : "/index/relationship/%{index}" % {:index => index}
  @connection.post(path, options)
end