deleteAll() with 'in' criteria

I have a grid with checkbox columns that fires an ajax request for my delete multiple records functionality. I have the javascript sending the array of checkbox Ids as a post request.

On the controller side I’m having trouble. I am passing a simple array (1,2,3,4) of ids to the deleteAll() function using this syntax:


MyModel::deleteAll(['in', 'id', $array]);

The result is that only the first ID gets deleted.

I have also tried this:


MyModel::deleteAll(['id'=>$array]);

In the meantime I’m just using the DAO-style query which works… but I’d like to understand the AR way of doing it.