Client object.
- Full name:
\MongoLite\Client
protected array $databases
protected string $path
protected array $options
Constructor
public __construct(string $path, array $options = []): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
string | - Pathname to database file or :memory: |
$options |
array |
List Databases
public listDBs(): array
Return Value:
List of database names
Select Collection
public selectCollection(string $database, string $collection): \MongoLite\Collection
Parameters:
Parameter | Type | Description |
---|---|---|
$database |
string | |
$collection |
string |
Select database
public selectDB(string $name): \MongoLite\Database
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string |
public __get(mixed $database): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$database |
mixed |