这是因为框架链接mongodb没有指定database
到目录下 vendor/topthink/think-orm/src/db/connector/Mongo.php下修改
if (empty($config['dsn'])) { $config['dsn'] = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] .($config['hostport'] ? ":{$config['hostport']}" : ''). ($config['database'] ? "/{$config['database']}" : ''); }