我想找到所有尚未与我的 Bar 关联的 Foo。我使用 neo4j.rb (4.1.2) 和 Rails (4.2)。我现在使用的产生正确输出但感觉不理想的代码是:
@foos = Foo.all.find_all do |foo|
foo.bars.rels_to(current_bar).count == 0
end
有没有更好的方法用 Cypher 做到这一点?
我想找到所有尚未与我的 Bar 关联的 Foo。我使用 neo4j.rb (4.1.2) 和 Rails (4.2)。我现在使用的产生正确输出但感觉不理想的代码是:
@foos = Foo.all.find_all do |foo|
foo.bars.rels_to(current_bar).count == 0
end
有没有更好的方法用 Cypher 做到这一点?