title: Yii2 mongodb activerecord find by date (YYYY-MM-DD)
body: <p>In mongodb <strong><em>created_on</em></strong> values is like <strong><em>YYYY-mm-dd H:i:s</em></strong> <em>e.g 2017-08-03 11:51:05</em>. but while searching outputs i have to pass only date <strong><em>YYYY-mm-dd</em></strong> but it is not working with Yii2 mongodb activerecord but it is working from terminal.</p>
  
  <p><strong>Mongodb activerecord :</strong></p>
  
  <pre><code>$output  = DeviceOutput::find()
                  -&gt;where(["created_on"=&gt;"/^$date/"])
                  -&gt;one();
  </code></pre>
  
  <p><strong>Terminal Command :</strong></p>
  
  <pre><code>db.device_output.find({"created_on":/^2017-08-03/})
  </code></pre>
  
  <p>How to do it in PHP ?</p>