get entities with metadata value

Hello all,

I have create an entity type, let's say with type object and subtype foo . I have associate a metadata value with it. So, I have a lot entities that have a field $e->count. Is it posible to get all those entities with $e->count greater than a number?

I know that I can do this by hand, first get all entities then check the count field and then display. But this approach breaks the pagination.

Thx