To transform the query params to Strapi's standard filters, you can use the `convertRestQueryParams` function from [strapi-utils](../global-strapi/api-reference.md#strapiutils).
If you are using a SQL database, calling `buildQuery` will return a [`Bookshelf Query`](https://bookshelfjs.org/api.html) on which you can call other functions (e.g. `count`).
If you are using a mongo database, calling `buildQuery` returns either a [`Mongoose Query`](https://mongoosejs.com/docs/api.html#Query) or a custom query when used with deep filtering.
When using the deep filtering feature with mongo, we build an aggregation query to avoid too many round-trips to the Mongo DB.
Doing that means we don't get a Mongoose object as a response but instead a plain JS Object. This brings some issues, like no virtual fields available and no Mongoose life cycles.