## MedplumClient.searchResources() method

Sends a FHIR search request for an array of resources.

This is a convenience method for `search()` that returns the resources as an array rather than a `Bundle`.

**Signature:**

```typescript
searchResources<RT extends ResourceType>(resourceType: RT, query?: QueryTypes, options?: MedplumRequestOptions): ReadablePromise<ResourceArray<WithId<ExtractResource<RT>>>>;
```

## Parameters

| Parameter     | Type                                        | Description                                                                                  |
|---------------|--------------------------------------------|----------------------------------------------------------------------------------------------|
| resourceType  | RT                                         | The FHIR resource type.                                                                      |
| query         | [QueryTypes](/content/docs/sdk/core.querytypes) | _(Optional)_ Optional FHIR search query or structured query object. Can be any valid input to the URLSearchParams() constructor. |
| options       | [MedplumRequestOptions](/content/docs/sdk/core.medplumrequestoptions) | _(Optional)_ Optional fetch options.                                                        |

**Returns:**

[ReadablePromise](/content/docs/sdk/core.readablepromise) < [ResourceArray](/content/docs/sdk/core.resourcearray) < [WithId](/content/docs/sdk/core.withid) <ExtractResource<RT>>>>>

Promise to the array of search results.

## Example

Example using a FHIR search string:

```typescript
const patients = await client.searchResources('Patient', 'name=Alice');

console.log(patients);
```

The return value is an array of resources.

See [FHIR search](https://www.hl7.org/fhir/search.html) for full details.
