PHP 클래스 yii\mongodb\Database

부터: 2.0
저자: Paul Klimov ([email protected])
상속: extends yii\base\Object
파일 보기 프로젝트 열기: yiisoft/yii2-mongodb

공개 프로퍼티들

프로퍼티 타입 설명
$connection MongoDB connection.
$name name of this database.

공개 메소드들

메소드 설명
clearCollections ( ) Clears internal collection lists.
createCollection ( string $name, array $options = [] ) : boolean Creates new collection.
createCommand ( array $document = [] ) : Command Creates MongoDB command associated with this database.
dropCollection ( string $name ) : boolean Drops specified collection.
getCollection ( string $name, boolean $refresh = false ) : Collection Returns the Mongo collection with the given name.
getFileCollection ( string $prefix = 'fs', boolean $refresh = false ) : Collection Returns Mongo GridFS collection with given prefix.
listCollections ( array $condition = [], array $options = [] ) : array Returns the list of available collections in this database.

보호된 메소드들

메소드 설명
selectCollection ( string $name ) : Collection Selects collection with given name.
selectFileCollection ( string $prefix ) : Collection Selects GridFS collection with given prefix.

메소드 상세

clearCollections() 공개 메소드

This method can be used to break cycle references between Database and Collection instances.
public clearCollections ( )

createCollection() 공개 메소드

Note: Mongo creates new collections automatically on the first demand, this method makes sense only for the migration script or for the case you need to create collection with the specific options.
public createCollection ( string $name, array $options = [] ) : boolean
$name string name of the collection
$options array collection options in format: "name" => "value"
리턴 boolean whether operation was successful.

createCommand() 공개 메소드

Creates MongoDB command associated with this database.
부터: 2.1
public createCommand ( array $document = [] ) : Command
$document array command document contents.
리턴 Command command instance.

dropCollection() 공개 메소드

Drops specified collection.
부터: 2.1
public dropCollection ( string $name ) : boolean
$name string name of the collection
리턴 boolean whether operation was successful.

getCollection() 공개 메소드

Returns the Mongo collection with the given name.
public getCollection ( string $name, boolean $refresh = false ) : Collection
$name string collection name
$refresh boolean whether to reload the collection instance even if it is found in the cache.
리턴 Collection Mongo collection instance.

getFileCollection() 공개 메소드

Returns Mongo GridFS collection with given prefix.
public getFileCollection ( string $prefix = 'fs', boolean $refresh = false ) : Collection
$prefix string collection prefix.
$refresh boolean whether to reload the collection instance even if it is found in the cache.
리턴 yii\mongodb\file\Collection Mongo GridFS collection.

listCollections() 공개 메소드

Returns the list of available collections in this database.
부터: 2.1.1
public listCollections ( array $condition = [], array $options = [] ) : array
$condition array filter condition.
$options array options list.
리턴 array collections information.

selectCollection() 보호된 메소드

Selects collection with given name.
protected selectCollection ( string $name ) : Collection
$name string collection name.
리턴 Collection collection instance.

selectFileCollection() 보호된 메소드

Selects GridFS collection with given prefix.
protected selectFileCollection ( string $prefix ) : Collection
$prefix string file collection prefix.
리턴 yii\mongodb\file\Collection file collection instance.

프로퍼티 상세

$connection 공개적으로 프로퍼티

MongoDB connection.
public $connection

$name 공개적으로 프로퍼티

name of this database.
public $name