Class: Neography::Rest::NodeIndexes
Instance Method Summary collapse
- #create_unique(index, key, value, properties = {}) ⇒ Object
- #get_or_create_unique(index, key, value, properties = {}) ⇒ Object
-
#initialize(connection) ⇒ NodeIndexes
constructor
A new instance of NodeIndexes.
Methods included from Paths
Methods included from Helpers
#get_id, #json_content_type, #parse_direction
Methods inherited from Indexes
#add, #create, #create_auto, #drop, #find, #find_by_key_value, #find_by_query, #get, #list, #remove, #remove_by_id, #remove_by_key, #remove_by_value
Constructor Details
#initialize(connection) ⇒ NodeIndexes
Returns a new instance of NodeIndexes.
17 18 19 |
# File 'lib/neography/rest/node_indexes.rb', line 17 def initialize(connection) super(connection, :node) end |
Instance Method Details
#create_unique(index, key, value, properties = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/neography/rest/node_indexes.rb', line 21 def create_unique(index, key, value, properties = {}) = { :body => ( { :properties => properties, :key => key, :value => value } ).to_json, :headers => json_content_type } @connection.post(unique_path(:index => index), ) end |
#get_or_create_unique(index, key, value, properties = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/neography/rest/node_indexes.rb', line 34 def get_or_create_unique(index, key, value, properties = {}) = { :body => ( { :properties => properties, :key => key, :value => value } ).to_json, :headers => json_content_type } @connection.post(uniqueness_path(:index => index, :function => 'get_or_create'), ) end |