用"IN"查询子句在Cy4中使用neo4j中的索引 [英] querying with an "IN" clause using the index in neo4j with Cypher
问题描述
我想在neo4j中使用我的auto_index并传递一个字符串数组来进行匹配.我知道您可以在cypher查询的末尾添加一个IN子句,但这不使用索引,我假设将对所有记录进行数据库扫描.用索引查询执行此操作的最佳方法是什么?
I'd like to use my auto_index in neo4j and pass in an array of strings to match against. I know that you can add an IN clause to the end of your cypher query but that doesn't use the indexes and I'm assuming will do a database scan of all the records. What's the best way to do this with an index query?
例如假设facebookId上有一个auto_index并且有100万个用户节点,请让我获得其facebookId在["123","456","789"]中的用户.
e.g. Get me users whose facebookId is in ["123", "456", "789"] assuming there is an auto_index on facebookId and there are 1 million user nodes.
推荐答案
我认为这值得一提:
START n=node:node_auto_index('facebookId:("123", "456", "789")')
...
示例: http://console.neo4j.org/r/3mcvr5
这篇关于用"IN"查询子句在Cy4中使用neo4j中的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!