PHP 클래스 Webiny\Component\Mongo\Mongo

상속: use trait Webiny\Component\StdLib\ComponentTrait, use trait Webiny\Component\StdLib\StdLibTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $uri, array $uriOptions = [], array $driverOptions = [], $collectionPrefix = '' )
aggregate ( $collectionName, array $pipeline, array $options = [] )
bulkWrite ( $collectionName, array $operations, array $options = [] )
command ( $command, array $options = [] )
count ( $collectionName, $filter = [], array $options = [] )
createCollection ( string $name, array $options = [] ) : array | object Create collection
createIndex ( $collectionName, Webiny\Component\Mongo\Index\IndexInterface $index, array $options = [] )
createIndexes ( $collectionName, array $indexes )
delete ( $collectionName, $filter, array $options = [] )
distinct ( $collectionName, $fieldName, $filter = [], array $options = [] )
dropCollection ( string $collectionName, array $options = [] ) : array | object Drop collection
dropIndex ( $collectionName, $indexName, array $options = [] )
dropIndexes ( $collectionName, array $options = [] )
find ( $collectionName, $filter = [], $sort = [], $limit, $skip, array $options = [] )
findOne ( $collectionName, $filter = [], array $options = [] )
findOneAndDelete ( $collectionName, $filter, array $options = [] )
findOneAndReplace ( $collectionName, $filter, $replacement, array $options = [] )
findOneAndUpdate ( $collectionName, $filter, $update, array $options = [] )
getCollectionPrefix ( ) : string Get collection prefix
getNamespace ( $collectionName )
id ( null | string $id = null ) : MongoDB\BSON\ObjectID Construct Mongo ID
insertMany ( $collectionName, array $documents, array $options = [] )
insertOne ( $collectionName, $document, array $options = [] )
isId ( $id ) : boolean Check if given string is a valid MongoId string
listCollections ( array $options = [] ) : mixed List collections
listIndexes ( string $collectionName, array $options = [] ) : array
selectDatabase ( string $database ) Select database
update ( $collectionName, $filter, $update, array $options = [] )

비공개 메소드들

메소드 설명
cName ( $collectionName ) : string Get collection name

메소드 상세

__construct() 공개 메소드

public __construct ( $uri, array $uriOptions = [], array $driverOptions = [], $collectionPrefix = '' )
$uriOptions array
$driverOptions array

aggregate() 공개 메소드

public aggregate ( $collectionName, array $pipeline, array $options = [] )
$pipeline array
$options array

bulkWrite() 공개 메소드

public bulkWrite ( $collectionName, array $operations, array $options = [] )
$operations array
$options array

command() 공개 메소드

public command ( $command, array $options = [] )
$options array

count() 공개 메소드

public count ( $collectionName, $filter = [], array $options = [] )
$options array

createCollection() 공개 메소드

Create collection
public createCollection ( string $name, array $options = [] ) : array | object
$name string Name
$options array
리턴 array | object

createIndex() 공개 메소드

public createIndex ( $collectionName, Webiny\Component\Mongo\Index\IndexInterface $index, array $options = [] )
$index Webiny\Component\Mongo\Index\IndexInterface
$options array

createIndexes() 공개 메소드

public createIndexes ( $collectionName, array $indexes )
$indexes array

delete() 공개 메소드

public delete ( $collectionName, $filter, array $options = [] )
$options array

distinct() 공개 메소드

public distinct ( $collectionName, $fieldName, $filter = [], array $options = [] )
$options array

dropCollection() 공개 메소드

Drop collection
public dropCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string
$options array
리턴 array | object

dropIndex() 공개 메소드

public dropIndex ( $collectionName, $indexName, array $options = [] )
$options array

dropIndexes() 공개 메소드

public dropIndexes ( $collectionName, array $options = [] )
$options array

find() 공개 메소드

public find ( $collectionName, $filter = [], $sort = [], $limit, $skip, array $options = [] )
$options array

findOne() 공개 메소드

public findOne ( $collectionName, $filter = [], array $options = [] )
$options array

findOneAndDelete() 공개 메소드

public findOneAndDelete ( $collectionName, $filter, array $options = [] )
$options array

findOneAndReplace() 공개 메소드

public findOneAndReplace ( $collectionName, $filter, $replacement, array $options = [] )
$options array

findOneAndUpdate() 공개 메소드

public findOneAndUpdate ( $collectionName, $filter, $update, array $options = [] )
$options array

getCollectionPrefix() 공개 메소드

Get collection prefix
public getCollectionPrefix ( ) : string
리턴 string

getNamespace() 공개 메소드

public getNamespace ( $collectionName )

id() 공개 메소드

Construct Mongo ID
public id ( null | string $id = null ) : MongoDB\BSON\ObjectID
$id null | string (Optional)
리턴 MongoDB\BSON\ObjectID

insertMany() 공개 메소드

public insertMany ( $collectionName, array $documents, array $options = [] )
$documents array
$options array

insertOne() 공개 메소드

public insertOne ( $collectionName, $document, array $options = [] )
$options array

isId() 공개 메소드

Check if given string is a valid MongoId string
public isId ( $id ) : boolean
$id
리턴 boolean

listCollections() 공개 메소드

List collections
public listCollections ( array $options = [] ) : mixed
$options array
리턴 mixed

listIndexes() 공개 메소드

public listIndexes ( string $collectionName, array $options = [] ) : array
$collectionName string
$options array
리턴 array

selectDatabase() 공개 메소드

Select database
public selectDatabase ( string $database )
$database string

update() 공개 메소드

public update ( $collectionName, $filter, $update, array $options = [] )
$options array