@@ -400,11 +400,7 @@ public function testGetTables()
400400 $ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
401401
402402 // Create a view (this creates system.views)
403- DB ::connection ('mongodb ' )->getDatabase ()->command ([
404- 'create ' => 'test_view ' ,
405- 'viewOn ' => 'newcollection ' ,
406- 'pipeline ' => [],
407- ]);
403+ DB ::connection ('mongodb ' )->getDatabase ()->createCollection ('test_view ' , ['viewOn ' => 'newcollection ' ]);
408404
409405 $ tables = Schema::getTables ();
410406 $ this ->assertIsArray ($ tables );
@@ -438,11 +434,7 @@ public function testGetViews()
438434 DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
439435 $ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
440436
441- DB ::connection ('mongodb ' )->getDatabase ()->command ([
442- 'create ' => 'test_view ' ,
443- 'viewOn ' => 'newcollection ' ,
444- 'pipeline ' => [],
445- ]);
437+ DB ::connection ('mongodb ' )->getDatabase ()->createCollection ('test_view ' , ['viewOn ' => 'newcollection ' ]);
446438
447439 $ tables = Schema::getViews ();
448440
@@ -476,11 +468,7 @@ public function testGetTableListing()
476468 DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
477469
478470 // Create a view (this creates system.views)
479- DB ::connection ('mongodb ' )->getDatabase ()->command ([
480- 'create ' => 'test_view ' ,
481- 'viewOn ' => 'newcollection ' ,
482- 'pipeline ' => [],
483- ]);
471+ DB ::connection ('mongodb ' )->getDatabase ()->createCollection ('test_view ' , ['viewOn ' => 'newcollection ' ]);
484472
485473 $ tables = Schema::getTableListing ();
486474
@@ -517,11 +505,7 @@ public function testGetTableListingBySchema()
517505 public function testSystemCollectionsArePresentButFiltered ()
518506 {
519507 // Create a view to trigger system.views collection
520- DB ::connection ('mongodb ' )->getDatabase ()->command ([
521- 'create ' => 'test_view ' ,
522- 'viewOn ' => 'newcollection ' ,
523- 'pipeline ' => [],
524- ]);
508+ DB ::connection ('mongodb ' )->getDatabase ()->createCollection ('test_view ' , ['viewOn ' => 'newcollection ' ]);
525509
526510 // Get all collections directly from MongoDB
527511 $ allCollections = DB ::connection ('mongodb ' )->getDatabase ()->listCollectionNames ();
0 commit comments