Creating indexed nodes on neo4j cypher via rest api -
i'm trying create indexed node in cypher, following syntax:
neo4j-sh (?)$ start m=node:person(uid= "1") return m; ==> +------------+ ==> | m | ==> +------------+ ==> | node[64]{} | ==> +------------+ ==> 1 row ==> 0 ms ==> neo4j-sh (?)$ start n = node(64) return n.uid; ==> entitynotfoundexception: property 'uid' not exist on node[64]
why node appears created, property i'm creating, , seems returned, not exist?
is there easier way? used use py2neo's function:
neo4j.graphdatabaseservice("http://localhost:7474/db/data/").get_or_create_indexed_node(index='person', key='uid', value=self.id, properties={'uid' : self.id})
but appears have been deprecated---it no longer works latest version of py2neo, not appear support properties
argument longer (and future folks, index
replaced index_name
).
an index , property 2 different things.
it seems have node in graph index named person
, key/value pair uid:"1". first query gets node index. index not property of node. can fire webadmin visualize how indices managed in graph.
as far know there nothing in documentation on how create indices cypher, can use rest api manipulate them (link).
Comments
Post a Comment