Hi,
I have a requirement to list all tables through code previously is built in mysql. Now I am using this plugin to list all collections but i cant find a replacement of below here:
$tables = DB::select('SHOW TABLES');
Any help would be appreciated
For anyone coming from google
Here is the available way to list all collections in the database.
foreach (\DB::connection()->getMongoDB()->listCollections() as $collection) {
echo $collection->getName() ;
}
Most helpful comment
For anyone coming from google
Here is the available way to list all collections in the database.