I am migrating my application from mysql to mongodb but some of the queries not working in mongodb:
$data = Post::where(\DB::raw("DATE_FORMAT(created_at,'%Y-%m-%d %H')""),Carbon::createFromTimestamp(time(),'America/New_York')->format('Y-m-d H'))->count(\DB::raw('DISTINCT postName'));
Here, i don' t know how to write this query for mongodb. Please help.
Laravel database does not support mongodb. It supports four databases: MySQL, Postgres, SQLite and SQL Server.
If you want to use mongodb in php, this will be helpful: http://php.net/manual/en/set.mongodb.php
or find third-party mongodb driver in https://packagist.org/