# Using Sort & Pagination with the Document Service API

> Source: https://docs.strapi.io/cms/api/document-service/sort-pagination

Use the Document Service API's `sort` and pagination parameters to order query results by single or multiple fields and control result limits with `limit` and `start`.

The [Document Service API](/cms/api/document-service) offers the ability to sort and paginate query results.

## Sort

To sort results returned by the Document Service API, include the `sort` parameter with queries.

### Sort on a single field

#### GET strapi.documents().findMany() — Sort on a single field

Sort results based on a single field using a string value.

**JavaScript:**
```
const documents = await strapi.documents("api::article.article").findMany({
  sort: "title:asc",
});
```

**Response 200 OK:**
```json
[
  {
    "documentId": "cjld2cjxh0000qzrmn831i7rn",
    "title": "Test Article",
    "slug": "test-article",
    "body": "Test 1"
  },
  {
    "documentId": "cjld2cjxh0001qzrm5q1j5q7m",
    "title": "Test Article 2",
    "slug": "test-article-2",
    "body": "Test 2"
  }
]
```

### Sort on multiple fields

#### GET strapi.documents().findMany() — Sort on multiple fields

Sort results on multiple fields by passing an array of sort objects.

**JavaScript:**
```
const documents = await strapi.documents("api::article.article").findMany({
  sort: [{ title: "asc" }, { slug: "desc" }],
});
```

**Response 200 OK:**
```json
[
  {
    "documentId": "cjld2cjxh0000qzrmn831i7rn",
    "title": "Test Article",
    "slug": "test-article",
    "body": "Test 1"
  },
  {
    "documentId": "cjld2cjxh0001qzrm5q1j5q7m",
    "title": "Test Article 2",
    "slug": "test-article-2",
    "body": "Test 2"
  }
]
```

## Pagination

#### GET strapi.documents().findMany() — Pagination

Paginate results using the limit and start parameters.

**JavaScript:**
```
const documents = await strapi.documents("api::article.article").findMany({
  limit: 10,
  start: 0,
});
```

**Response 200 OK:**
```json
[
  {
    "documentId": "cjld2cjxh0000qzrmn831i7rn",
    "title": "Test Article",
    "slug": "test-article",
    "body": "Test 1"
  },
  {
    "documentId": "cjld2cjxh0001qzrm5q1j5q7m",
    "title": "Test Article 2",
    "slug": "test-article-2",
    "body": "Test 2"
  }
]
```
