---
lang: en
title: 'API docs: repository.modelmetadatahelper.getmodelmetadata'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.modelmetadatahelper.getmodelmetadata.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [ModelMetadataHelper](./repository.modelmetadatahelper.md) &gt; [getModelMetadata](./repository.modelmetadatahelper.getmodelmetadata.md)

## ModelMetadataHelper.getModelMetadata() method

A utility function to simplify retrieving metadata from a target model and its properties.

**Signature:**

```typescript
static getModelMetadata(target: Function, options?: InspectionOptions): ModelDefinition | {};
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | Function | The class from which to retrieve metadata. |
|  options | [InspectionOptions](./metadata.inspectionoptions.md) | _(Optional)_ An options object for the MetadataInspector to customize the output of the metadata retrieval functions. |

**Returns:**

[ModelDefinition](./repository.modeldefinition.md) \| {}


