mongodb\ActiveQuery modify()

modify() public method

Performs 'findAndModify' query and returns a single row of result.

Warning: in case 'new' option is set to 'false' (which is by default) usage of this method may lead to unexpected behavior at some Active Record features, because object will be populated by outdated data.

public yii\mongodb\ActiveRecord|array|null modify ( $update, $options = [], $db = null )
$update array

Update criteria

$options array

List of options in format: optionName => optionValue.

$db yii\mongodb\Connection

The Mongo connection used to execute the query.

return yii\mongodb\ActiveRecord|array|null

The original document, or the modified document when $options['new'] is set. 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.