mongodb\Query scalar()

scalar() public method (available since version 2.1.2)

Returns the query result as a scalar value.

The value returned will be the first column in the first row of the query results. Column _id will be automatically excluded from select fields, if select() is not empty and _id is not selected explicitly.

public string|null|false scalar ( $db = null )
$db yii\mongodb\Connection

The MongoDB connection used to generate the query. If this parameter is not given, the mongodb application component will be used.

return string|null|false

The value of the first column in the first row of the query result. false is returned if the query result is empty.

doc_Yii
2016-10-30 17:09:01
Comments
Leave a Comment

Please login to continue.