Property | Type | Description | |
---|---|---|---|
$connection | MongoDB connection. | ||
$name | name of this database. |
Method | Description | |
---|---|---|
clearCollections ( ) | Clears internal collection lists. | |
createCollection ( string $name, array $options = [] ) : boolean | Creates new collection. | |
createCommand ( array $document = [] ) : |
Creates MongoDB command associated with this database. | |
dropCollection ( string $name ) : boolean | Drops specified collection. | |
getCollection ( string $name, boolean $refresh = false ) : |
Returns the Mongo collection with the given name. | |
getFileCollection ( string $prefix = 'fs', boolean $refresh = false ) : |
Returns Mongo GridFS collection with given prefix. | |
listCollections ( array $condition = [], array $options = [] ) : array | Returns the list of available collections in this database. |
Method | Description | |
---|---|---|
selectCollection ( string $name ) : |
Selects collection with given name. | |
selectFileCollection ( string $prefix ) : |
Selects GridFS collection with given prefix. |
public clearCollections ( ) |
public createCommand ( array $document = [] ) : |
||
$document | array | command document contents. |
return | command instance. |
public dropCollection ( string $name ) : boolean | ||
$name | string | name of the collection |
return | boolean | whether operation was successful. |
public getCollection ( string $name, boolean $refresh = false ) : |
||
$name | string | collection name |
$refresh | boolean | whether to reload the collection instance even if it is found in the cache. |
return | Mongo collection instance. |
public getFileCollection ( string $prefix = 'fs', boolean $refresh = false ) : |
||
$prefix | string | collection prefix. |
$refresh | boolean | whether to reload the collection instance even if it is found in the cache. |
return | Mongo GridFS collection. |
protected selectCollection ( string $name ) : |
||
$name | string | collection name. |
return | collection instance. |
protected selectFileCollection ( string $prefix ) : |
||
$prefix | string | file collection prefix. |
return | file collection instance. |