@@ -143,7 +143,7 @@ public function getTables()
143143 $ collections = [];
144144
145145 foreach ($ db ->listCollectionNames () as $ collectionName ) {
146- $ stats = $ db ->selectCollection ($ collectionName )->aggregate ([
146+ $ stats = $ db ->getCollection ($ collectionName )->aggregate ([
147147 ['$collStats ' => ['storageStats ' => ['scale ' => 1 ]]],
148148 ['$project ' => ['storageStats.totalSize ' => 1 ]],
149149 ])->toArray ();
@@ -176,7 +176,7 @@ public function getTableListing()
176176
177177 public function getColumns ($ table )
178178 {
179- $ stats = $ this ->connection ->getMongoDB ()->selectCollection ($ table )->aggregate ([
179+ $ stats = $ this ->connection ->getMongoDB ()->getCollection ($ table )->aggregate ([
180180 // Sample 1,000 documents to get a representative sample of the collection
181181 ['$sample ' => ['size ' => 1_000 ]],
182182 // Convert each document to an array of fields
@@ -224,7 +224,7 @@ public function getColumns($table)
224224
225225 public function getIndexes ($ table )
226226 {
227- $ indexes = $ this ->connection ->getMongoDB ()->selectCollection ($ table )->listIndexes ();
227+ $ indexes = $ this ->connection ->getMongoDB ()->getCollection ($ table )->listIndexes ();
228228
229229 $ indexList = [];
230230 foreach ($ indexes as $ index ) {
0 commit comments