Mongodb
和rails
Parent
对象has_many :children
Child
有parent_id
个班级BSON::ObjectId
Child.first.parent_id
=> BSON::ObjectId('59031cd92936094d04000d31')
我找不到Parent
_id
Parent.where(_id: '59031cd92936094d04000d31').first
=> nil
Parent
对象看起来像这样
=> #<Parent _id: 5a959865c8aedf03c1000007, _type: nil, created_at: nil, updated_at: nil, id: nil, name: nil, description: nil, type: nil, starts_at: nil, children_hash: nil>