yii\mongodb\ActiveRecord::primaryKey PHP Méthode

primaryKey() public static méthode

The default implementation will return ['_id']. Note that an array should be returned even for a collection with single primary key.
public static primaryKey ( ) : string[]
Résultat string[] the primary keys of the associated Mongo collection.
    public static function primaryKey()
    {
        return ['_id'];
    }