You are viewing an offline version of MongoDB documentation. Some page features might be unavailable. To view the latest version of the page or use interactive features, visit the live page.
MongoDB\Model\DatabaseInfo::isEmpty()
Definition
Return Values
A boolean indicating whether the database has any data.
Examples
$info = new DatabaseInfo(['empty' => true]); var_dump($info->isEmpty());
The output would then resemble:
bool(true)
See Also
listDatabases command reference in the MongoDB manual