Join us Sept 17 at .local NYC! Use code WEB50 to save 50% on tickets. Learn more >
MongoDB Event
Docs Menu
Docs Home
/ / /
PHP Library Manual
/ / /

MongoDB\Model\DatabaseInfo::isEmpty()

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()

On this page