2015-02-24 50 views
1

如何在以Mongoid进行查询,“这里是不是空”?例如如何在Mongoid中查询“where not not null”?

where('comment_id IS NOT NULL') 

如何与mongoid做到吗?

+0

是的,它干活等待,只要它需要时间来做到这一点。这样的规则初学者从计算器) – vveare138 2015-02-24 10:34:30

+0

没有问题..继续,老兄! :-) :-) – 2015-02-24 10:36:22

回答

1

试试这个

Model.where(:comment_id.exists => true)