diff --git a/index.php b/index.php index 00161b6..73334a3 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ * * @var string */ -define('MPG_APP_VERSION', '0.9.5'); +define('MPG_APP_VERSION', '0.9.6'); /** * Development mode? diff --git a/src/Controllers/CollectionController.php b/src/Controllers/CollectionController.php index 20b6257..f6b0e6f 100644 --- a/src/Controllers/CollectionController.php +++ b/src/Controllers/CollectionController.php @@ -195,7 +195,7 @@ public function enumFieldsAction($databaseName, $collectionName) : Response { $documents = $collection->find([], ['limit' => 1])->toArray(); if ( empty($documents) ) { - return new Response(404, 'Collection is empty'); + return new Response(200, json_encode([]), ['Content-Type' => 'application/json']); } $documentFields = MongoDBHelper::arrayKeysMulti(