---
url: "https://vueda.dev/v3/reference/api/js/stores/storeModelChoices/functions/storeModelChoices.md"
title: "storeModelChoices"
---

# storeModelChoices

## Overview

A store for lookup choices for a particular model field.

## Signature

`storeModelChoices(pinia, hot)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-pinia">pinia</span> | `Pinia` | no | Pinia instance to retrieve the store |
| <span id="param-hot">hot</span> | `StoreGeneric` | no | dev only hot module replacement |

### Returns

`Store`

## Properties

### $id {#id}

Id of the store. Used by map helpers.

Type: `"modelChoices"`

Source: `node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.43_typescript@5.9.3_/node_modules/pinia/dist/pinia.d.ts:654`

### authScopeGeneration {#authScopeGeneration}

Incremented by `clearAuthScoped`. Fetches capture it before issuing and discard their
response if it changed while the request was in flight.

Type: `number`

Source: `client/lib/stores/storeModelChoices.js:98`

### choices {#choices}

Choice lists for model fields, keyed by app and model dot name, then by field name. A fetched
list is the server's paginated response, with `{label, value}` items in `results`.

Type: `object`

Source: `client/lib/stores/storeModelChoices.js:70`

### filterChoices {#filterChoices}

Choice lists for filters, keyed by app and model dot name, then by filter name. A fetched list
is the server's paginated response, with `{label, value}` items in `results`.

Type: `object`

Source: `client/lib/stores/storeModelChoices.js:77`

### filterPromises {#filterPromises}

The in-flight `fetchFilterChoices` requests, keyed by app and model dot name, then by filter
name. A request removes its entry when it settles.

Type: `object`

Source: `client/lib/stores/storeModelChoices.js:91`

### promises {#promises}

The in-flight `fetchChoices` requests, keyed by app and model dot name, then by field name. A
request removes its entry when it settles.

Type: `object`

Source: `client/lib/stores/storeModelChoices.js:84`

## Methods

- [clearAuthScoped](/v3/reference/api/js/stores/storeModelChoices/methods/clearAuthScoped.md) - Drops every cached choice list, because choices are row-level filtered for the authenticated user.
- [fetchChoices](/v3/reference/api/js/stores/storeModelChoices/methods/fetchChoices.md) - Fetches the choice list for a model field and stores it in `choices`.
- [fetchFilterChoices](/v3/reference/api/js/stores/storeModelChoices/methods/fetchFilterChoices.md) - Fetches the choice list for a filter and stores it in `filterChoices`.
- [initializeChoice](/v3/reference/api/js/stores/storeModelChoices/methods/initializeChoice.md) - Creates the empty per-model container in `choices`, or in `filterChoices` for a filter, if it does not exist yet.
- [setChoices](/v3/reference/api/js/stores/storeModelChoices/methods/setChoices.md) - Stores a choice list for a model field without fetching it.
- [setFilterChoices](/v3/reference/api/js/stores/storeModelChoices/methods/setFilterChoices.md) - Stores a choice list for a filter without fetching it.

## Source

`client/lib/stores/storeModelChoices.js:62`
