[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Lookup](https://evolu.dev/docs/api-reference/common/Lookup) › structuralLookup

```ts
function structuralLookup<K>(key: Structural<K>): StructuralLookupKey;
```

Defined in: [packages/common/src/Lookup.ts:332](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Lookup.ts#L332)

Returns the structural lookup key for `key`.

Structural lookup keys are derived from JSON-like values plus `Uint8Array`.
Equal structures produce the same lookup key even when they are different
JavaScript instances.

The derived key is memoized by non-null object identity in a module-scoped
`WeakMap` shared by all callers, so keys must be immutable.

Use this as a [Lookup](https://evolu.dev/docs/api-reference/common/Lookup/type-aliases/Lookup) when logical equality should be based on
structural value instead of reference identity.

### Example

```ts
const byFilter = createLookupMap<
  { readonly table: string; readonly where: readonly [string, string] },
  string,
  StructuralLookupKey
>({
  lookup: structuralLookup,
});

byFilter.set({ table: "todo", where: ["owner", "ada"] }, "cached");
byFilter.get({ table: "todo", where: ["owner", "ada"] }); // "cached"
```

## See

- [StructuralKey](https://evolu.dev/docs/api-reference/common/Lookup/type-aliases/StructuralKey)
- [Structural](https://evolu.dev/docs/api-reference/common/Lookup/type-aliases/Structural)