Method |
Description |
|
__construct ( string $dsn = null, array $options = null ) |
|
|
__get ( $name ) |
|
|
createPersistence ( ) : Sokil\Mongo\Persistence |
Create new persistence manager |
|
debug ( $enabled = true ) |
Enable or disable debug mode |
|
getCollection ( string $name ) : Collection |
Get collection from previously selected database by self::useDatabase() |
|
getConnectOptions ( ) |
|
|
getConnections ( ) : array |
Get list of all active connections through this client |
|
getCurrentDatabaseName ( ) : string |
Get name of current database |
|
getDatabase ( string $name = null ) : Database |
Get database instance |
|
getDbVersion ( ) : string |
|
|
getDsn ( ) |
|
|
getLogger ( ) : Psr\Log\LoggerInterface |
|
|
getMongoClient ( ) : MongoClient |
Get mongo connection instance |
|
getReadPreference ( ) |
|
|
getVersion ( ) : string |
|
|
getWriteConcern ( ) : string | integer |
Get currently active write concern on connection level |
|
hasLogger ( ) : boolean |
Check if logger defined |
|
isDebugEnabled ( ) |
Check state of debug mode |
|
map ( array $mapping ) : Client |
Map database and collection name to class. |
|
readNearest ( array $tags = null ) |
|
|
readPrimaryOnly ( ) |
|
|
readPrimaryPreferred ( array $tags = null ) |
|
|
readSecondaryOnly ( array $tags = null ) |
|
|
readSecondaryPreferred ( array $tags = null ) |
|
|
removeLogger ( ) : Client |
Remove logger |
|
setConnectOptions ( array $options ) : Client |
Set connect options |
|
setCredentials ( type $username, type $password ) : Client |
Set credentials to auth on db, specified in connect options or dsn. |
|
setDsn ( $dsn ) |
|
|
setLogger ( Psr\Log\LoggerInterface $logger ) |
|
|
setMajorityWriteConcern ( integer $timeout = 10000 ) : Client |
Define majority write concern on whole requests |
|
setMongoClient ( MongoClient $client ) : Client |
Set mongo's client |
|
setUnacknowledgedWriteConcern ( integer $timeout = 10000 ) : Client |
Define unacknowledged write concern on whole requests |
|
setWriteConcern ( string | integer $w, integer $timeout = 10000 ) : Client |
Define write concern on whole requests |
|
useDatabase ( string $name ) : Client |
Select database |
|