# FindAll

```typescript
const page = 3;
const limit = 500;
const select = { name: true }

const exampleArray = await this.examplesRepository.findAll(
  {
    page,
    limit,
    where: { name: "example" },
    ["relation-1", "relation-2.nested-relation"] // or { "relation-1": true, "relation-2": { nested-relation: true } }
    order: { id: 'ASC' },
    select,
  },
  trx,
);

/** Find all where name = "example"
 * Select name only
 * Filter where index is between 1000 and 1500
 * Load their relations (use . to load nested relations)
 * Count the amount of items
 * Sorts the result from the lowest value to the highest value
 */

output: { examples: [exampleArray], amount: 500 }
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cross-packages.gitbook.io/cross-api/services/find-all.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
