PHP 클래스 Sokil\Mongo\Database

파일 보기 프로젝트 열기: sokil/php-mongo 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Client $client, MongoDB | string $database )
__get ( $name )
authenticate ( string $username, string $password )
clearCollectionPool ( )
createCappedCollection ( string $name, integer $maxElements, integer $size ) : Collection
createCollection ( string $name, array $options = null ) : Collection Create collection
disableCollectionPool ( )
disableProfiler ( )
enableCollectionPool ( )
executeCommand ( array $command, array $options = [] ) : array Execute Mongo command
executeJS ( $code, array $args = [] )
findProfilerRows ( ) : Cursor
getCache ( string $namespace ) : Cache Get cache
getClient ( ) : Client
getCollection ( string $name ) : Collection
getDocumentByReference ( array $ref, boolean $useDocumentPool = true ) : Document | null Get Document instance by it's reference
getGridFS ( string $name = 'fs' ) : GridFS Get instance of GridFS
getLastError ( )
getMongoDB ( ) : MongoDB
getName ( ) : string
getProfilerLevel ( )
getProfilerParams ( )
getProfilerSlowMs ( )
getQueue ( string $channel ) : Queue
getReadPreference ( )
getWriteConcern ( ) : mixed Get current write concern May be used only if mongo extension version >=1.5
isCollectionPoolEmpty ( )
isCollectionPoolEnabled ( )
logout ( )
map ( string | array $name, string | array | Definition | null $classDefinition = null ) : Client Map collection name to class
profileAllQueries ( $slowms = null )
profileSlowQueries ( $slowms = 100 )
readNearest ( array $tags = null )
readPrimaryOnly ( )
readPrimaryPreferred ( array $tags = null )
readSecondaryOnly ( array $tags = null )
readSecondaryPreferred ( array $tags = null )
resetMapping ( ) : Client Reset specified mapping
setMajorityWriteConcern ( integer $timeout = 10000 ) : Database Define majority write concern.
setUnacknowledgedWriteConcern ( integer $timeout = 10000 ) : Database Define unacknowledged write concern.
setWriteConcern ( string | integer $w, integer $timeout = 10000 ) : Database Define write concern.
stats ( )

비공개 메소드들

메소드 설명
defineCollection ( string $name, Definition | array | string $definition ) : Database Define collection through array or Definition instance
getCollectionDefinition ( string $name, array $defaultDefinition = null ) : string | array Get class name mapped to collection

메소드 상세

__construct() 공개 메소드

public __construct ( Client $client, MongoDB | string $database )
$client Client
$database MongoDB | string

__get() 공개 메소드

public __get ( $name )

authenticate() 공개 메소드

public authenticate ( string $username, string $password )
$username string
$password string

clearCollectionPool() 공개 메소드

public clearCollectionPool ( )

createCappedCollection() 공개 메소드

public createCappedCollection ( string $name, integer $maxElements, integer $size ) : Collection
$name string name of collection
$maxElements integer The maximum number of elements to store in the collection.
$size integer Size in bytes.
리턴 Collection

createCollection() 공개 메소드

Create collection
public createCollection ( string $name, array $options = null ) : Collection
$name string name of collection
$options array array of options
리턴 Collection

disableCollectionPool() 공개 메소드

disableProfiler() 공개 메소드

public disableProfiler ( )

enableCollectionPool() 공개 메소드

executeCommand() 공개 메소드

Execute Mongo command
public executeCommand ( array $command, array $options = [] ) : array
$command array
$options array
리턴 array

executeJS() 공개 메소드

public executeJS ( $code, array $args = [] )
$args array

findProfilerRows() 공개 메소드

public findProfilerRows ( ) : Cursor
리턴 Cursor

getCache() 공개 메소드

Get cache
public getCache ( string $namespace ) : Cache
$namespace string
리턴 Cache

getClient() 공개 메소드

public getClient ( ) : Client
리턴 Client

getCollection() 공개 메소드

public getCollection ( string $name ) : Collection
$name string name of collection
리턴 Collection

getDocumentByReference() 공개 메소드

Get Document instance by it's reference
public getDocumentByReference ( array $ref, boolean $useDocumentPool = true ) : Document | null
$ref array reference to document
$useDocumentPool boolean try to get document from pool or fetch document from database
리턴 Document | null

getGridFS() 공개 메소드

Get instance of GridFS
public getGridFS ( string $name = 'fs' ) : GridFS
$name string prefix of files and chunks collection
리턴 GridFS

getLastError() 공개 메소드

public getLastError ( )

getMongoDB() 공개 메소드

public getMongoDB ( ) : MongoDB
리턴 MongoDB

getName() 공개 메소드

public getName ( ) : string
리턴 string get name of database

getProfilerLevel() 공개 메소드

public getProfilerLevel ( )

getProfilerParams() 공개 메소드

public getProfilerParams ( )

getProfilerSlowMs() 공개 메소드

public getProfilerSlowMs ( )

getQueue() 공개 메소드

public getQueue ( string $channel ) : Queue
$channel string name of channel
리턴 Queue

getReadPreference() 공개 메소드

public getReadPreference ( )

getWriteConcern() 공개 메소드

Get current write concern May be used only if mongo extension version >=1.5
public getWriteConcern ( ) : mixed
리턴 mixed

isCollectionPoolEmpty() 공개 메소드

isCollectionPoolEnabled() 공개 메소드

logout() 공개 메소드

public logout ( )

map() 공개 메소드

Map collection name to class
public map ( string | array $name, string | array | Definition | null $classDefinition = null ) : Client
$name string | array collection name or array like [collectionName => collectionClass, ...]
$classDefinition string | array | Sokil\Mongo\Collection\Definition | null if $name is string, then full class name or array with parameters, else omitted
리턴 Client

profileAllQueries() 공개 메소드

public profileAllQueries ( $slowms = null )

profileSlowQueries() 공개 메소드

public profileSlowQueries ( $slowms = 100 )

readNearest() 공개 메소드

public readNearest ( array $tags = null )
$tags array

readPrimaryOnly() 공개 메소드

public readPrimaryOnly ( )

readPrimaryPreferred() 공개 메소드

public readPrimaryPreferred ( array $tags = null )
$tags array

readSecondaryOnly() 공개 메소드

public readSecondaryOnly ( array $tags = null )
$tags array

readSecondaryPreferred() 공개 메소드

public readSecondaryPreferred ( array $tags = null )
$tags array

resetMapping() 공개 메소드

Reset specified mapping
public resetMapping ( ) : Client
리턴 Client

setMajorityWriteConcern() 공개 메소드

May be used only if mongo extension version >=1.5
public setMajorityWriteConcern ( integer $timeout = 10000 ) : Database
$timeout integer timeout in milliseconds
리턴 Database

setUnacknowledgedWriteConcern() 공개 메소드

May be used only if mongo extension version >=1.5
public setUnacknowledgedWriteConcern ( integer $timeout = 10000 ) : Database
$timeout integer timeout in milliseconds
리턴 Database

setWriteConcern() 공개 메소드

May be used only if mongo extension version >=1.5
public setWriteConcern ( string | integer $w, integer $timeout = 10000 ) : Database
$w string | integer write concern
$timeout integer timeout in milliseconds
리턴 Database

stats() 공개 메소드

public stats ( )