Ruby 如何使用密码查询neo4j节点的时间范围?

Ruby 如何使用密码查询neo4j节点的时间范围?,ruby,neo4j,cypher,neography,Ruby,Neo4j,Cypher,Neography,我有以下资料: @neo.execute_query("match (node) where node.value = 'Rachel' return node.uuid, node.epoch_utc_i, node.value") => {"columns"=>["node.uuid", "node.epoch_utc_i", "node.value"], "data"=>[["87f7d4c7-c161-4ba2-bce6-8c3c5104f60c", 1493774

我有以下资料:

@neo.execute_query("match (node) where node.value = 'Rachel' return node.uuid, node.epoch_utc_i, node.value")

 => {"columns"=>["node.uuid", "node.epoch_utc_i", "node.value"], "data"=>[["87f7d4c7-c161-4ba2-bce6-8c3c5104f60c", 1493774726, "Rachel"], ["23574509-3d67-4783-a00a-66a2b49b5cbd", 1493968856, "Rachel"], ["e7f01367-baa6-431b-8760-1979c215d777", 1494035989, "Rachel"], ["4cc0f450-a1c4-4992-85c1-9bcb4d759d6a", 1494047641, "Rachel"], ["e3a83a43-3b0f-4a7f-944b-4f582fb47b72", 1494183024, "Rachel"], ["1d8be261-e788-449c-9fa1-9db82816fa37", 1494531971, "Rachel"]]}
但是,我无法使用
WHERE
仅返回那些时间介于今天和昨天之间的
epoch\u utc\u I
时间,例如:

2.2.1 :045 > yesterday = Chronic.parse('1 day ago').to_i
 => 1494906466 

2.2.1 :046 > @neo.execute_query("match (node) where node.value Contains 'Rachel' AND node.epoch_utc_i > yesterday return node.uuid, node.epoch_utc_i, node.value")
Neography::SyntaxException: NeographyError: 
--message: Variable `yesterday` not defined (line 1, column 72 (offset: 71))
编辑:尝试将值传递到查询中

@neo.execute_query("match (node)-[:gratefulFor]->(node2) where node.bot_client_id = 'aiaas-1409611358153-user-0149' AND node2.epoch_utc_i > $yesterday return node.bot_client_id, node2.epoch_utc_i, node2.value", {:yesterday => yesterday})

Neography::SyntaxException: NeographyError: 
--message: Variable `$yesterday` not defined (line 1, column 121 (offset: 120))

--request: {:path=>"/db/data/cypher", :body=>"{\"query\":\"match (node)-[:gratefulFor]->(node2) where node.bot_client_id = 'aiaas-1409611358153-user-0149' AND node2.epoch_utc_i > $yesterday return node.bot_client_id, node2.epoch_utc_i, node2.value\",\"params\":{\"yesterday\":1494908349}}"},
问题:


我如何才能像我在上面的代码中预期的那样,只实现那些历元时间大于昨天历元时间的节点?

您必须将变量传递给查询。使用
$dayed
{dayed}
(旧符号)将参数传递给Cypher查询。查询内容如下:

MATCH (node) WHERE node.value 
CONTAINS 'Rachel' AND node.epoch_utc_i > {yesterday} 
RETURN node.uuid, node.epoch_utc_i, node.value"
查询执行将传递昨天变量并插入上面的查询中

@neo.execute_query(query, {:yesterday => yesterday})

它不起作用:@neo.execute_query(“匹配(节点)-[:gratefulFor]->(node2)其中node.bot_client_id='aiaas-1409611358153-user-0149'和node2.epoch_utc_i>$dayear return node.bot_client_id,node2.epoch_utc_i,node2.value',{:dayed=>dayed})Neography::SyntaxException:NeographyError:--消息:变量
$Dayed
未定义(第1行,第121列(偏移量:120)),请尝试使用
{Dayed}
语法,因为
$Dayed
是一种非常新的符号。这似乎有效,太棒了!但相关的问题是如何传递关系的值,而不是硬编码
:感谢
…我将更新问题。