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

MongoDB\Model\DatabaseInfo::isEmpty()

On this page

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

Return whether the database has any data.

function isEmpty(): boolean

A boolean indicating whether the database has any data.

<?php
$info = new DatabaseInfo(['empty' => true]);
var_dump($info->isEmpty());

The output would then resemble:

bool(true)
  • listDatabases command reference in the MongoDB manual

Back

getSizeOnDisk()