I am using Mongoid to connect to mongodb and you need help with the request.
I have a parent model where each parent and child has a name.
Class Parent field: :name field: :child_name end
I could split the child into another model and / or build into it, but my database needs are simple. I want to request all documents where the child name matches the name of the parent. (for example, father is Jeff and son is Jeff).
Tried the following, but it does not work.
parent = Parent.where(name: :child_name)
I don't know how to do this with Mongoid. Any help is much appreciated
source share