Closed
Description
MongoDB stores system information in collections that use the .system.* namespace, which MongoDB reserves for internal use. Do not create collections that begin with system.
https://www.mongodb.com/docs/manual/reference/system-collections/
.system.profile
.system.js
.system.views
Is your feature request related to a problem?
system.views is a systems collection but in laravel includes it in the result which causes issue with testing traits that drops all tables
Other system collection that could in the testing database
.system.profile
.system.js
Describe the solution you'd like
Exclude it when dropping all tables, like using migrate:fresh, testing traits like RefreshDatabase, DatabaseMigration
Additional context

Temporary solution add a custom command, but I strongly think that system collections should be excluded in listCollectionNames
$database = DB::connection('mongodb')->getMongoDB();
foreach ($database->listCollectionNames() as $collectionName) {
if (in_array($collectionName, ['system.views', 'system.profile'])) {
continue;
}
DB::table($collectionName)->delete();
}
Metadata
Metadata
Assignees
Labels
No labels