# Sorting by id is no longer possible to sort by chronological order

> Source: https://docs.strapi.io/cms/migration/v4-to-v5/breaking-changes/sort-by-id

Sorting by `id` no longer works chronologically in Strapi 5 due to uuid-based documents; use `createdAt` with the Document Service API instead.

In Strapi 5, sorting by `id` to sort by chronological order is no longer possible since [documents](/cms/api/document) use an uuid.

This page is part of the [breaking changes database](/cms/migration/v4-to-v5/breaking-changes) and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.

- Is this breaking change affecting plugins? Yes
- Is this breaking change automatically handled by a codemod? Yes
  - Codemod: [entity-service-document-service](https://github.com/strapi/strapi/blob/develop/packages/utils/upgrade/resources/codemods/5.0.0/entity-service-document-service.code.ts)

## Breaking change description

**In Strapi v4**

In Strapi v4, using the Entity Service API, you could do the following to sort entries by chronological order:

```js
strapi.entityService.findMany('api::article.article', {
  sort: 'id',
});
```

**In Strapi 5**

In Strapi 5, use the [Document Service API](/cms/api/document-service) to sort documents by chronological order, use the `createdAt` field:

```js
strapi.documentService.findMany('api::article.article', {
  sort: 'createdAt',
});
```

## Migration

This section regroups useful notes and procedures about the introduced breaking change.

### Manual procedure

No manual procedure should be required as this will be handled by a codemod.
