# Function generateId

- generateId<N>(collectionName, input): undefined | string

- Compute an ID for a given collection name and input. This accepts either a full [[Resources.Input | `Resources.Input<"<collectionName>">`]] representation or an object containing only the relevant subset of [[Resources.IdFields | `Resources.IdFields<"<collectionName>">`]].

  #### Type Parameters

  - #### N extends Resources.CollectionName

  #### Parameters

  - ##### collectionName: N

  - ##### input: undefined | StrictIdInput<Resources.Collections, N> | Resources.Input<N>

  #### Returns undefined | string

  - Defined in packages/db/src/system.ts:59

Generated using TypeDoc