You might make use of count?
const count = await strapi.db.query('api::blog.article').count({ where: { title: { $startsWith: 'v3', }, }, });
However for more aggregate-Functions there’s a PR that might come in near future.
Cheers, Olaf