title: what is the best way for reference id of child object in parent object in mongoid?
body: <p>I have 2 objects;</p>
  
  <p><strong>board.rb</strong></p>
  
  <pre><code>class Board
    include Mongoid::Document
    has_many :posts, :autosave =&gt; true, dependent: :destroy
    field :collected, :type =&gt; Array, :default =&gt; []
  end
  </code></pre>
  
  <p><strong>post.rb</strong></p>
  
  <pre><code>class Post
    include Mongoid::Document
    belongs_to :board
  end
  </code></pre>
  
  <p><strong>In addition</strong> to the relationship that is created by default, I want to create a field in which to store or reference the posts in the parent object (<strong>Board</strong>).</p>
  
  <p>Is it possible to create a reference without needs to duplicate the object? As well as the relationship that is created by default? What is the optimal way to do it?</p>
  
  <p>Create an array field (<strong>collected field</strong>) and enter the ids of all the posts or is there a better way?</p>
  
  <p>I do not want duplicate objects, I just want to have a reference of the original objects and after I want find this object with a <strong>where</strong> query or <strong>find</strong> query.</p>
  
  <p>How can I do it?</p>
  
  <p>Thank you!</p>