Is there a way to search for a node with a specific property using py2neo? (I have a bunch of nodes with {"word": "some word"}, and I want to be able to search through nodes to find a node whose word attribute has a specific value)
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I suggest that you consider using an index for this kind of requirement. You can index the nodes against the properties you need to search for and then refer to this index for your search.
Otherwise, you're left with a reasonably non-performant Cypher query:
START n=node(*)
WHERE n.word! = 'some word'
RETURN n
I'd recommend against using this though as it will have to sift through the entire database and therefore be very resource hungry and slow as your database grows.