Find()->count() gives InvalidArgumentException

I am really feeling stupid, but I do not manage to count. What am I doing wrong here?

In my controller:
(as written in Query Builder - 4.x)

$total = $this->Measurements->find()->where([‘id’ => $ids])->count();

I get the error message " Cannot convert value of type array to string - InvalidArgumentException"

Looking at the link provided, and at your code, and the error message, I assume that $ids is an array?

In which case try: -

$total = $this->Measurements->find()->where(['id IN' => $ids])->count();

Untested; but its seems you need to use the IN statement in your query.

Great, thank you so much. I guessed it was some stupid detail.