# Query Engine API

> Source: https://docs.strapi.io/cms/api/query-engine

The Query Engine API provides low-level, unrestricted backend access to Strapi's database layer through `strapi.db.query`, supporting single and bulk operations with filtering, populating, ordering, and pagination.

The Strapi backend provides a Query Engine API to interact with the database layer at a lower level.

:::caution
In most cases you should not use the Query Engine API and rather use the [Document Service API](/cms/api/document-service).

Only use the Query Engine API if you exactly know what you are doing, for instance if you want to use a lower-level API that directly interacts with unique rows of the database.

Please keep in mind that the Query Engine API is not aware of the most advanced Strapi 5 features like Draft & Publish, Internationalization, Content History, and possibly more.
This also means that the Query Engine API will not be able to use `documentId` and will use `id`, which means it could lead to unattended consequences at the database level or partial or incomplete compatibility with Strapi 5 features. 
:::

:::prerequisites
Before diving deeper into the Query Engine API documentation, it is recommended that you read the following introductions:
- the [backend customization introduction](/cms/backend-customization),
- and the [Content APIs introduction](/cms/api/content-api).
:::

## Basic usage

The Query Engine is available through `strapi.db.query`:

```js
strapi.db.query('api::blog.article').findMany({ // uid syntax: 'api::api-name.content-type-name'
  where: {
    title: {
      $startsWith: '2021',
      $endsWith: 'v4',
    },
  },
  populate: {
    category: true,
  },
});
```

## Available operations

The Query Engine allows the following operations on database entries:

- [Single operations](/cms/api/query-engine/single-operations): Create, read, update, and delete single database entries with the Query Engine API.
- [Bulk operations](/cms/api/query-engine/bulk-operations): Create, read, update, and delete multiple database entries with the Query Engine API.
- [Filters](/cms/api/query-engine/filtering): Get exactly what you need by filtering database entries with the Query Engine API.
- [Populate](/cms/api/query-engine/populating): Get additional data with your Query Engine API queries by populating relations.
- [Order & Pagination](/cms/api/query-engine/order-pagination): Sort and paginate the results of your Query Engine API queries.
