title: yii2-mongodb: How i can make the has many or has one relationship between two collection
body: <p>I am using the two collection which are State and City and want to relationship between both of them and using the below code for these:</p>
  
  <p><strong>common\models\State.php</strong></p>
  
  <pre><code>return $this-&gt;hasMany(City::className(), ['state_id'=&gt;'_id']);
  </code></pre>
  
  <p><strong>common\models\City.php</strong></p>
  
  <pre><code>return $this-&gt;hasOne(State::className(), ['_id' =&gt;'state_id']);
  </code></pre>
  
  <p>When i run the below code, it is running and return blank result for cities.</p>
  
  <pre><code>$model = \common\models\State::find()-&gt;all();
  </code></pre>
  
  <p>When i change the <code>state_id</code> type in collection with <code>ObjectId</code> then it returns result. So please suggest me how can i typecast the <code>state_id</code> in relation.</p>