MongoDB: Display arrays as JSON

This commit is contained in:
Jakub Vrana 2021-02-09 16:34:42 +01:00
parent c24a6a6aef
commit f44f186b38

View file

@ -66,7 +66,7 @@ if (isset($_GET["mongo"])) {
(is_a($val, 'MongoDB\BSON\UTCDatetime') ? $val->toDateTime()->format('Y-m-d H:i:s') :
(is_a($val, 'MongoDB\BSON\Binary') ? $val->getData() : //! allow downloading
(is_a($val, 'MongoDB\BSON\Regex') ? strval($val) :
(is_object($val) ? json_encode($val, 256) : // 256 = JSON_UNESCAPED_UNICODE
(is_object($val) || is_array($val) ? json_encode($val, 256) : // 256 = JSON_UNESCAPED_UNICODE
$val // MongoMinKey, MongoMaxKey
)))));
}