PHP 클래스 PHPDaemon\Clients\Mongo\Collection

저자: Vasily Zorin ([email protected])
상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$name Name of collection
$pool Related Pool object

공개 메소드들

메소드 설명
__construct ( string $name, Pool $pool ) : void Contructor of MongoClientAsyncCollection
aggregate ( array $p, callable $cb ) : void Aggregate
autoincrement ( callable $cb, boolean $plain = false ) : void Generation autoincrement
count ( callable $cb, array $p = [] ) : void Counts objects in collection
ensureIndex ( array $keys, array $options = [], callable $cb = null ) : void Ensure index
evaluate ( string $code, callable $cb ) : void Evaluates a code on the server side
find ( callable $cb, array $p = [] ) : void Finds objects in collection
findAll ( callable $cb, array $p = [] ) : void Finds objects in collection and fires callback when got all objects
findAndModify ( array $p, callable $cb ) : void Generation autoincrement
findOne ( callable $cb, array $p = [] ) : void Finds one object in collection
group ( callable $cb, array $p = [] ) : void Groupping function
insert ( array $doc, callable $cb = null, array $params = null ) : MongoId Inserts an object
insertMulti ( array $docs, callable $cb = null, array $params = null ) : array Inserts several documents
insertOne ( array $doc, callable $cb = null, array $params = null ) : MongoId Inserts an object
remove ( array $cond = [], callable $cb = null, array $params = null ) : void Removes objects from collection
update ( array $cond, array $data, integer $flags, callable $cb = null, array $params = null ) : void Updates one object in collection
updateMulti ( array $cond, array $data, callable $cb = null, array $params = null ) : void Updates one object in collection
updateOne ( array $cond, array $data, callable $cb = null, array $params = null ) : void Updates one object in collection
upsert ( array $cond, array $data, boolean $multi = false, callable $cb = null, array $params = null ) : void Upserts an object (updates if exists, insert if not exists)
upsertMulti ( array $cond, array $data, callable $cb = null, array $params = null ) : void Upserts an object (updates if exists, insert if not exists)
upsertOne ( array $cond, array $data, callable $cb = null, array $params = null ) : void Upserts an object (updates if exists, insert if not exists)

메소드 상세

__construct() 공개 메소드

Contructor of MongoClientAsyncCollection
public __construct ( string $name, Pool $pool ) : void
$name string Name of collection
$pool Pool Pool
리턴 void

aggregate() 공개 메소드

Aggregate
public aggregate ( array $p, callable $cb ) : void
$p array Params
$cb callable Callback called when response received
리턴 void

autoincrement() 공개 메소드

Generation autoincrement
public autoincrement ( callable $cb, boolean $plain = false ) : void
$cb callable Called when response received
$plain boolean Plain?
리턴 void

count() 공개 메소드

Counts objects in collection
public count ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, where, col)
리턴 void

ensureIndex() 공개 메소드

Ensure index
public ensureIndex ( array $keys, array $options = [], callable $cb = null ) : void
$keys array Keys
$options array Optional. Options
$cb callable Optional. Callback called when response received
리턴 void

evaluate() 공개 메소드

Evaluates a code on the server side
public evaluate ( string $code, callable $cb ) : void
$code string Code
$cb callable Callback called when response received
리턴 void

find() 공개 메소드

Finds objects in collection
public find ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, tailable, where, col, fields, sort, hint, explain, snapshot, orderby, parse_oplog)
리턴 void

findAll() 공개 메소드

Finds objects in collection and fires callback when got all objects
public findAll ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, tailable, where, col, fields, sort, hint, explain, snapshot, orderby, parse_oplog)
리턴 void

findAndModify() 공개 메소드

Generation autoincrement
public findAndModify ( array $p, callable $cb ) : void
$p array Params
$cb callable Callback called when response received
리턴 void

findOne() 공개 메소드

Finds one object in collection
public findOne ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, opts, where, col, fields, sort, hint, explain, snapshot, orderby, parse_oplog)
리턴 void

group() 공개 메소드

Groupping function
public group ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, key, col, reduce, initial)
리턴 void

insert() 공개 메소드

Inserts an object
public insert ( array $doc, callable $cb = null, array $params = null ) : MongoId
$doc array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 MongoId

insertMulti() 공개 메소드

Inserts several documents
public insertMulti ( array $docs, callable $cb = null, array $params = null ) : array
$docs array Array of docs
$cb callable Optional. Callback called when response received.
$params array Optional. Params
리턴 array IDs

insertOne() 공개 메소드

Inserts an object
public insertOne ( array $doc, callable $cb = null, array $params = null ) : MongoId
$doc array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 MongoId

remove() 공개 메소드

Removes objects from collection
public remove ( array $cond = [], callable $cb = null, array $params = null ) : void
$cond array Conditions
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

update() 공개 메소드

Updates one object in collection
public update ( array $cond, array $data, integer $flags, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$flags integer Optional. Flags
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

updateMulti() 공개 메소드

Updates one object in collection
public updateMulti ( array $cond, array $data, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

updateOne() 공개 메소드

Updates one object in collection
public updateOne ( array $cond, array $data, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

upsert() 공개 메소드

Upserts an object (updates if exists, insert if not exists)
public upsert ( array $cond, array $data, boolean $multi = false, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$multi boolean Optional. Multi-flag
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

upsertMulti() 공개 메소드

Upserts an object (updates if exists, insert if not exists)
public upsertMulti ( array $cond, array $data, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

upsertOne() 공개 메소드

Upserts an object (updates if exists, insert if not exists)
public upsertOne ( array $cond, array $data, callable $cb = null, array $params = null ) : void
$cond array Conditions
$data array Data
$cb callable Optional. Callback called when response received
$params array Optional. Params
리턴 void

프로퍼티 상세

$name 공개적으로 프로퍼티

Name of collection
public $name

$pool 공개적으로 프로퍼티

Related Pool object
public $pool