@@ -400,11 +400,7 @@ public function testGetTables()
400
400
$ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
401
401
402
402
// 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 ' ]);
408
404
409
405
$ tables = Schema::getTables ();
410
406
$ this ->assertIsArray ($ tables );
@@ -438,11 +434,7 @@ public function testGetViews()
438
434
DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
439
435
$ dbName = DB ::connection ('mongodb ' )->getDatabaseName ();
440
436
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 ' ]);
446
438
447
439
$ tables = Schema::getViews ();
448
440
@@ -476,11 +468,7 @@ public function testGetTableListing()
476
468
DB ::connection ('mongodb ' )->table ('newcollection_two ' )->insert (['test ' => 'value ' ]);
477
469
478
470
// 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 ' ]);
484
472
485
473
$ tables = Schema::getTableListing ();
486
474
@@ -517,11 +505,7 @@ public function testGetTableListingBySchema()
517
505
public function testSystemCollectionsArePresentButFiltered ()
518
506
{
519
507
// 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 ' ]);
525
509
526
510
// Get all collections directly from MongoDB
527
511
$ allCollections = DB ::connection ('mongodb ' )->getDatabase ()->listCollectionNames ();
0 commit comments