# GetKeyArray(AllocatorHandle)

> Returns an array with a copy of all the keys (in no particular order).

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public NativeArray<TKey> GetKeyArray(AllocatorManager.AllocatorHandle allocator)
```

### Parameters

**** (\[AllocatorHandle]\(/engine/6000.7/script-reference/unity/collections/allocatormanager/allocatorhandle)): The allocator to use.

### Returns

| Type                                                                                 | Description                                                    |
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| [NativeArray\<T>](/engine/6000.7/script-reference/unity/collections/nativearray1.md) | An array with a copy of all the keys (in no particular order). |

### Remarks

A key with "N" values is included "N" times in the array.

Use `GetUniqueKeyArray` of [NativeParallelHashMapExtensions](/engine/6000.7/script-reference/unity/collections/nativeparallelhashmapextensions.md) instead if you only want one occurrence of each key.
