Neo4j和Rails:使用neo4j.rb按日期查询

时间:2022-09-03 17:59:58

I have a simple model in Rails called Shows. In my controller, if I do

我在Rails中有一个名为Shows的简单模型。在我的控制器中,如果我这样做

@show = Show.all

@show = Show.all

it works as expected, all shows are displayed. If I want to edit an existing show and do this:

它按预期工作,显示所有节目。如果我想编辑现有节目并执行此操作:

@show = Show.find(:id(params[:id]))

@show = Show.find(:id(params [:id]))

It finds it in the database and populates the form correctly.

它在数据库中找到它并正确填充表单。

If I want to present a list of only upcoming Shows, how would I do that? Every show has a property, show_date with type "Date," so the info is in there. I know I can do a range with Neo4j so I should be able to tell it to search from today's date until 20 years from now or something... but what is the query?

如果我想要仅列出即将到来的节目列表,我该怎么做?每个节目都有一个属性,show_date类型为“日期”,所以信息就在那里。我知道我可以用Neo4j做一个范围,所以我应该能够告诉它从今天的日期开始搜索,直到现在的20年或者其他什么......但是查询是什么?

Beginner question here, apologies if I'm overlooking something simple.

这里有初学者的问题,如果我忽略了一些简单的事情,我会道歉。

1 个解决方案

#1


0  

Andreas, the developer of Neo4j.rb, answered my question here: https://groups.google.com/forum/?fromgroups=#!msg/neo4jrb/ROTZF6yobdI/CaePi-rxkGAJ

Neo4j.rb的开发人员Andreas在这里回答了我的问题:https://groups.google.com/forum/?fromgroups =#!msg / neo4jrb / ROTZF6yobdI / CaP-rxkGAJ

#1


0  

Andreas, the developer of Neo4j.rb, answered my question here: https://groups.google.com/forum/?fromgroups=#!msg/neo4jrb/ROTZF6yobdI/CaePi-rxkGAJ

Neo4j.rb的开发人员Andreas在这里回答了我的问题:https://groups.google.com/forum/?fromgroups =#!msg / neo4jrb / ROTZF6yobdI / CaP-rxkGAJ