1.9.3p0 :058 > Post.where(:id => '4f35120b1d41c819ad000002')
=> #<Mongoid::Criteria
selector: {:id=>"4f35120b1d41c819ad000002,"},
options: {},
class: Post,
embedded: false>
1.9.3p0 :103 > Post.find('4f35120b1d41c819ad000002')
=> #<Post_id: 4f35120b1d41c819ad000002, _type: nil, created_at: 2012-02-10 12:48:11 UTC, updated_at: 2012-02-10 12:48:11 UTC, content: "11111111111", commented_at: nil, comments_count: 0, views_count: 5, user_id: BSON::ObjectId('4f3511e61d41c819ad000001')>
find 和 where 的差别,是不是 find 只能接受 BSON::ObjectId 做参数?而 where 却可以接受 :conditions 参数?
Post.where 返回的 Mongoid::Criteria 是什么类型?是一个数组吗?
谢谢!