PHP Class PHPDaemon\Clients\Mongo\Collection

Author: Vasily Zorin ([email protected])
Inheritance: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
Afficher le fichier Open project: kakserpom/phpdaemon Class Usage Examples

Méthodes publiques

Свойство Type Description
$name Name of collection
$pool Related Pool object

Méthodes publiques

Méthode Description
__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)

Method Details

__construct() public méthode

Contructor of MongoClientAsyncCollection
public __construct ( string $name, Pool $pool ) : void
$name string Name of collection
$pool Pool Pool
Résultat void

aggregate() public méthode

Aggregate
public aggregate ( array $p, callable $cb ) : void
$p array Params
$cb callable Callback called when response received
Résultat void

autoincrement() public méthode

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

count() public méthode

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)
Résultat void

ensureIndex() public méthode

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
Résultat void

evaluate() public méthode

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

find() public méthode

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)
Résultat void

findAll() public méthode

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)
Résultat void

findAndModify() public méthode

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

findOne() public méthode

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)
Résultat void

group() public méthode

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)
Résultat void

insert() public méthode

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
Résultat MongoId

insertMulti() public méthode

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
Résultat array IDs

insertOne() public méthode

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
Résultat MongoId

remove() public méthode

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
Résultat void

update() public méthode

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
Résultat void

updateMulti() public méthode

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
Résultat void

updateOne() public méthode

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
Résultat void

upsert() public méthode

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
Résultat void

upsertMulti() public méthode

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
Résultat void

upsertOne() public méthode

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
Résultat void

Property Details

$name public_oe property

Name of collection
public $name

$pool public_oe property

Related Pool object
public $pool