Considering dropping this in favour of Constraint
neo.createUniqueNode('people', 'name', 'Kieve', { age: 18 }, 'create_or_fail')
createUniqueNode: createUniqueNode = (label, key, value, params, mode = "getorcreate") -> utils.post( "#{@url}/db/data/index/node/#{label}?uniqueness=#{mode}", { key: key value: value properties: params }, (node) -> id = node.body.self.split('/') id = id[id.length - 1] node.body.data._id = id
return node.body.data
)
cUniqueNode: createUniqueNode
Note that the response contains URI/templates for the available operations for readting properties and relationships. Details
neo.readNode(1)
It crash the database, need further investigation Details
neo
.readNodeByLabel('person')
neo
.readNodeByLabel('person', { name: 'kieve chua' })
readNodeByLabel: readNodeByLabel = (label, property) -> if property utils.get("#{@url}/db/data/label/#{label}/nodes", property) else utils.get("#{@url}/db/data/label/#{label}/nodes") rNodeByLabel: readNodeByLabel
Create node
Without properties Details
With properties Details