interface CursorInterface implements Iterator (View source)

Wrapper for the PHP MongoCursor class.

Methods

array|object|null
getSingleResult()

Return the first element or null if no elements exist.

from Iterator
array
toArray()

Return all elements as an array.

from Iterator
$this
addOption(string $key, mixed $value)

Wrapper method for MongoCursor::addOption().

$this
batchSize(integer $num)

Wrapper method for MongoCursor::batchSize().

boolean
dead()

Wrapper method for MongoCursor::dead().

array
explain()

Wrapper method for MongoCursor::explain().

$this
fields(array $f)

Wrapper method for MongoCursor::fields().

getCollection()

Return the collection for this cursor.

array
getFields()

Return the selected fields (projection).

array|null
getNext()

Wrapper method for MongoCursor::getNext().

array
getQuery()

Return the query criteria.

array
getReadPreference()

Wrapper method for MongoCursor::getReadPreference().

$this
setReadPreference(string $readPreference, array $tags = null)

Set the read preference.

boolean
getUseIdentifierKeys()

Return whether the document's "_id" value is used as its iteration key.

$this
setUseIdentifierKeys(boolean $useIdentifierKeys)

Set whether to use the document's "_id" value as its iteration key.

boolean
hasNext()

Wrapper method for MongoCursor::hasNext().

$this
hint(array|string $keyPattern)

Wrapper method for MongoCursor::hint().

$this
immortal(boolean $liveForever = true)

Wrapper method for MongoCursor::immortal().

array
info()

Wrapper method for MongoCursor::info().

$this
limit(integer $num)

Wrapper method for MongoCursor::limit().

recreate()

Recreates the internal MongoCursor.

reset()

Wrapper method for MongoCursor::reset().

$this
skip(integer $num)

Wrapper method for MongoCursor::skip().

$this
slaveOkay(boolean $ok = true)

Wrapper method for MongoCursor::slaveOkay().

$this
snapshot()

Wrapper method for MongoCursor::snapshot().

$this
sort(array $fields)

Wrapper method for MongoCursor::sort().

$this
tailable(boolean $tail = true)

Wrapper method for MongoCursor::tailable().

$this
timeout(integer $ms)

Wrapper method for MongoCursor::timeout().

Details

array|object|null getSingleResult()

Return the first element or null if no elements exist.

Return Value

array|object|null

array toArray()

Return all elements as an array.

Return Value

array

$this addOption(string $key, mixed $value)

Wrapper method for MongoCursor::addOption().

Parameters

string $key
mixed $value

Return Value

$this

See also

http://php.net/manual/en/mongocursor.addoption.php

$this batchSize(integer $num)

Wrapper method for MongoCursor::batchSize().

Parameters

integer $num

Return Value

$this

See also

http://php.net/manual/en/mongocursor.batchsize.php

boolean dead()

Wrapper method for MongoCursor::dead().

Return Value

boolean

See also

http://php.net/manual/en/mongocursor.dead.php

array explain()

Wrapper method for MongoCursor::explain().

$this fields(array $f)

Wrapper method for MongoCursor::fields().

Parameters

array $f Fields to return (or not return).

Return Value

$this

See also

http://php.net/manual/en/mongocursor.fields.php

Collection getCollection()

Return the collection for this cursor.

Return Value

Collection

array getFields()

Return the selected fields (projection).

Return Value

array

array|null getNext()

Wrapper method for MongoCursor::getNext().

Return Value

array|null

See also

http://php.net/manual/en/mongocursor.getnext.php

array getQuery()

Return the query criteria.

Return Value

array

array getReadPreference()

Wrapper method for MongoCursor::getReadPreference().

$this setReadPreference(string $readPreference, array $tags = null)

Set the read preference.

Parameters

string $readPreference
array $tags

Return Value

$this

See also

http://php.net/manual/en/mongocursor.setreadpreference.php

boolean getUseIdentifierKeys()

Return whether the document's "_id" value is used as its iteration key.

Return Value

boolean

$this setUseIdentifierKeys(boolean $useIdentifierKeys)

Set whether to use the document's "_id" value as its iteration key.

Parameters

boolean $useIdentifierKeys

Return Value

$this

boolean hasNext()

Wrapper method for MongoCursor::hasNext().

Return Value

boolean

See also

http://php.net/manual/en/mongocursor.hasnext.php

$this hint(array|string $keyPattern)

Wrapper method for MongoCursor::hint().

Parameters

array|string $keyPattern

Return Value

$this

See also

http://php.net/manual/en/mongocursor.hint.php

$this immortal(boolean $liveForever = true)

Wrapper method for MongoCursor::immortal().

Parameters

boolean $liveForever

Return Value

$this

See also

http://php.net/manual/en/mongocursor.immortal.php

array info()

Wrapper method for MongoCursor::info().

Return Value

array

See also

http://php.net/manual/en/mongocursor.info.php

$this limit(integer $num)

Wrapper method for MongoCursor::limit().

Parameters

integer $num

Return Value

$this

See also

http://php.net/manual/en/mongocursor.limit.php

recreate()

Recreates the internal MongoCursor.

reset()

$this skip(integer $num)

Wrapper method for MongoCursor::skip().

Parameters

integer $num

Return Value

$this

See also

http://php.net/manual/en/mongocursor.skip.php

$this slaveOkay(boolean $ok = true)

Wrapper method for MongoCursor::slaveOkay().

Parameters

boolean $ok

Return Value

$this

See also

http://php.net/manual/en/mongocursor.slaveokay.php

$this snapshot()

Wrapper method for MongoCursor::snapshot().

$this sort(array $fields)

Wrapper method for MongoCursor::sort().

Parameters

array $fields

Return Value

$this

See also

http://php.net/manual/en/mongocursor.sort.php

$this tailable(boolean $tail = true)

Wrapper method for MongoCursor::tailable().

Parameters

boolean $tail

Return Value

$this

See also

http://php.net/manual/en/mongocursor.tailable.php

$this timeout(integer $ms)

Wrapper method for MongoCursor::timeout().

Parameters

integer $ms

Return Value

$this

See also

http://php.net/manual/en/mongocursor.timeout.php