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 compone