title: Laravel 5.2 application migrating from mysql to mongodb, but Query not working
body: <p>I am migrating my application from mysql to mongodb but some of the queries not working in mongodb:</p>
  
  <pre><code>$data = Post::where(\DB::raw("DATE_FORMAT(created_at,'%Y-%m-%d %H')""),Carbon::createFromTimestamp(time(),'America/New_York')-&gt;format('Y-m-d H'))-&gt;count(\DB::raw('DISTINCT postName'));
  </code></pre>
  
  <p>Here, i don' t know how to write this query for mongodb. Please help.</p>