PHP 클래스 Phalcon\Db\Adapter\MongoDB\Database

파일 보기 프로젝트 열기: phalcon/incubator

공개 메소드들

메소드 설명
__construct ( MongoDB\Driver\Manager $manager, string $databaseName, array $options = [] ) Constructs new Database instance.
__debugInfo ( ) : array Return internal properties for debugging purposes.
__get ( string $collectionName ) : Collection Select a collection within this database.
__toString ( ) : string Return the database name.
command ( array | object $command, array $options = [] ) : MongoDB\Driver\Cursor Execute a command on this database.
createCollection ( string $collectionName, array $options = [] ) : array | object Create a new collection explicitly.
drop ( array $options = [] ) : array | object Drop this database.
dropCollection ( string $collectionName, array $options = [] ) : array | object Drop a collection within this database.
getDatabaseName ( ) : string Returns the database name.
listCollections ( array $options = [] ) : Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator Returns information for all collections in this database.
selectCollection ( string $collectionName, array $options = [] ) : Collection Select a collection within this database.
withOptions ( array $options = [] ) : Database Get a clone of this database with different options.

메소드 상세

__construct() 공개 메소드

This class provides methods for database-specific operations and serves as a gateway for accessing collections. Supported options: * readConcern (MongoDB\Driver\ReadConcern): The default read concern to use for database operations and selected collections. Defaults to the Manager's read concern. * readPreference (MongoDB\Driver\ReadPreference): The default read preference to use for database operations and selected collections. Defaults to the Manager's read preference. * typeMap (array): Default type map for cursors and BSON documents. * writeConcern (MongoDB\Driver\WriteConcern): The default write concern to use for database operations and selected collections. Defaults to the Manager's write concern.
public __construct ( MongoDB\Driver\Manager $manager, string $databaseName, array $options = [] )
$manager MongoDB\Driver\Manager Manager instance from the driver
$databaseName string Database name
$options array Database options

__debugInfo() 공개 메소드

Return internal properties for debugging purposes.
또한 보기: http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
public __debugInfo ( ) : array
리턴 array

__get() 공개 메소드

Note: collections whose names contain special characters (e.g. ".") may be selected with complex syntax (e.g. $database->{"system.profile"}) or {@link selectCollection()}.
또한 보기: http://php.net/oop5.overloading#object.get
또한 보기: http://php.net/types.string#language.types.string.parsing.complex
public __get ( string $collectionName ) : Collection
$collectionName string Name of the collection to select
리턴 Collection

__toString() 공개 메소드

Return the database name.
public __toString ( ) : string
리턴 string

command() 공개 메소드

Execute a command on this database.
또한 보기: DatabaseCommand::__construct() for supported options
public command ( array | object $command, array $options = [] ) : MongoDB\Driver\Cursor
$command array | object Command document
$options array Options for command execution
리턴 MongoDB\Driver\Cursor

createCollection() 공개 메소드

Create a new collection explicitly.
또한 보기: CreateCollection::__construct() for supported options
public createCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string
$options array
리턴 array | object Command result document

drop() 공개 메소드

Drop this database.
또한 보기: DropDatabase::__construct() for supported options
public drop ( array $options = [] ) : array | object
$options array Additional options
리턴 array | object Command result document

dropCollection() 공개 메소드

Drop a collection within this database.
또한 보기: DropCollection::__construct() for supported options
public dropCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string Collection name
$options array Additional options
리턴 array | object Command result document

getDatabaseName() 공개 메소드

Returns the database name.
public getDatabaseName ( ) : string
리턴 string

listCollections() 공개 메소드

Returns information for all collections in this database.
또한 보기: ListCollections::__construct() for supported options
public listCollections ( array $options = [] ) : Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator
$options array
리턴 Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator

selectCollection() 공개 메소드

Select a collection within this database.
또한 보기: Collection::__construct() for supported options
public selectCollection ( string $collectionName, array $options = [] ) : Collection
$collectionName string Name of the collection to select
$options array Collection constructor options
리턴 Collection

withOptions() 공개 메소드

Get a clone of this database with different options.
또한 보기: Database::__construct() for supported options
public withOptions ( array $options = [] ) : Database
$options array Database constructor options
리턴 Database