Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\DatabaseInfo::getSizeOnDisk()

On this page

  • Definition
  • Return Values
  • Examples
  • See Also
MongoDB\Model\DatabaseInfo::getSizeOnDisk()

Return the total size of the database file on disk in bytes.

function getSizeOnDisk(): integer

The total size of the database file on disk in bytes.

<?php
$info = new DatabaseInfo(['sizeOnDisk' => 1048576]);
var_dump($info->getSizeOnDisk());

The output would then resemble:

int(1048576)
  • listDatabases command reference in the MongoDB manual

Back

getName()