# Input-error code `'collection-options-mismatch'`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts`, `tables/problems.json` and `services/onsite-scripter/scripts/contract-docs-what-to-do.json` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

A member of [`InputErrorCode`](../api/InputErrorCode.md) · stable · since 2.0.0

[`collection()`](../api/Writer.collection.md) on a live name with another `attachTo`.

## What to do

The name is live with another `attachTo`: call [`session.collection(name)`](../api/Writer.collection.md) without options to get it, or `dispose()` it first and create it again with the new `attachTo`.

```ts
session.collection('handles').dispose();
await session.collection('handles', { attachTo: session.node(doorId) }).load(knobUrl, { key: 'knob' });
```

## Where the declaration names it

- [`CollectionOptions.attachTo`](../api/CollectionOptions.attachTo.md): Applies at creation only; on a live name, an omitted `attachTo` is no check and a different one throws 'collection-options-mismatch'.
- [`Writer.collection`](../api/Writer.collection.md): Errors: throws HoloInputError 'collection-role-mismatch' or 'collection-options-mismatch' when the name is live with a different `role` or `attachTo` (compared by value; a [`Part`](../api/Part.md) as the part it stands for).

The set is open: handle a code you don't know (`'other'`).
