因此,我有以下查询:
SELECT
i.mongodb_id
FROM
display_list_lists dll
JOIN
display_lists dl
ON
dll.display_list_id = dl._id
JOIN
list_items li
ON
dll.list_id = li.list_id
JOIN
items i
ON
li.item_id = i._id
WHERE
dl.mongodb_id = ?
AND
dl.account_id =
我目前正在指定一个存储线程注释树的项目。
对于那些不熟悉我所讲的内容的人,我会解释,基本上每个评论都有一个父评论,而不只是属于一个线程。目前,我正在开发一个关系型SQL Server模型来存储这些数据,原因很简单,因为我已经习惯了这一点。看起来是这样的:
Id int --PK
ThreadId int --FK
UserId int --FK
ParentCommentId int --FK (relates back to Id)
Comment nvarchar(max)
Time datetime
我所做的就是选择ThreadId的所有注释,然后在代码中递归地构建我的对象树。我
我有一个包含数百万个文档的集合的MongoDB数据库,我需要的是根据列中的某些条件对这些文档进行查询。我仔细阅读了Apache钻机的文档,因为它允许用SQL编写查询,所以我很感兴趣,但我担心性能。我的疑问是:
select * from table where col1= cond1 and col2= cond2 ... and col12=cond12;
只有两个条件是强制性的,但在不同的“列”上最多有12个条件,Solr更适合这样做吗?或者Apache是否适合这项工作?我真的到处找过了,Apache钻机的文档更丰富了。谢谢
我正在创建这样一个新的迁移:
rails g migration add_confirmable_to_devise
它在:db/migrate/YYYYMMDDxxx_add_confirmable_to_devise.rb中生成文件
我补充说:
class AddConfirmableToDevise < ActiveRecord::Migration
# Note: You can't use change, as User.update_all will fail in the down migration
def up
add_column :users