# The getWhere() method for permission provider instances has been removed

> Source: https://docs.strapi.io/cms/migration/v4-to-v5/breaking-changes/get-where-removed

The `getWhere()` method for permission provider instances has been removed in Strapi 5; use `provider.values().filter()` with a custom predicate instead to query and match provider items.

In Strapi 5, the `getWhere()` method for permission provider instances has been removed, and users should first get the provider values, then filter them.

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? No

## Breaking change description

**In Strapi v4**

Provider instances (action provider, condition provider, etc…) are built using a provider factory.

Those providers have a `getWhere` method allowing you to query provider’s items that match certain conditions and return them.

The query was an object where keys and values were matched with the provider entries:

```js
const values = provider.getWhere({ foo: 42, bar: 'baz' });
```

<br/>

**In Strapi 5**

You need to adopt a more conventional approach by first getting the provider values, then filtering them using a custom predicate:

```js
const values = provider.values().filter(value => value.foo === 42 && value.bar === 'baz');
```

## Migration

<br/>

### Manual procedure

Users need to manually update their code if using the `getWhere()` method, using the following example as a guide:

**In Strapi v4**

```tsx
const values = provider.getWhere({ foo: 42, bar: 'baz' });
```

<br/>

**In Strapi 5**

```tsx
const values = provider.values().filter(
  value => value.foo === 42 && value.bar === 'baz'
);
```
