1
使用mongodb和mongoid。如何抓住所有文章。只有20分鐘前創建了評論的文章?我將如何抓取20分鐘前創建的評論文章?
class Article
include Mongoid::Document
has_many :comments
end
class Comment
include Mongoid::Document
belongs_to :article
end
隨着引用關係,我不認爲這會工作。雖然我不明白爲什麼這是被接受的答案。 – rubish