mongodb\ActiveQuery one()

one() public method

Executes query and returns a single row of result.

public yii\mongodb\ActiveRecord|array|null one ( $db = null )
$db yii\mongodb\Connection

The Mongo connection used to execute the query. If null, the Mongo connection returned by $modelClass will be used.

return yii\mongodb\ActiveRecord|array|null

A single row of query result. Depending on the setting of asArray(), the query result may be either an array or an ActiveRecord object. Null will be returned if the query results in nothing.

doc_Yii
2016-10-30 17:07:23
Comments
Leave a Comment

Please login to continue.