【发布时间】:2011-07-10 22:31:07
【问题描述】:
我正在尝试在 mongoid (mongoid.org ORM) 中实现此功能:
select * from parents
inner join children
on parents.id = children.parent_id
where children.created_at <= some_timestamp
父母嵌入孩子,孩子属于父母
到目前为止我没有任何问题:Parent.where(:child.exists => true),但我不知道我应该如何做相当于 'child.created_at'.lt => some_timestamp (对字符串使用方法是非法的。)
谢谢
【问题讨论】: