forEachMetaData MethodStatic
Deprecated in 5.0 - will not be removed until after 2026-06-13. Use getSchemaView() on the iModel and iterate view.findClass(classFullName)?.getProperties() instead.
Invoke a callback on each property of the specified class, optionally including superclass properties.
forEachMetaData(iModel: IModelDb, classFullName: string, wantSuper: boolean, func: PropertyCallback, includeCustom: boolean = true): void
@note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
@example
// Current usage:
IModelDb.forEachMetaData(imodel, "BisCore:Element", true, (name: string, propMetaData: PropertyMetaData) => {
console.log(`Property name: ${name}, Property type: ${propMetaData.primitiveType}`);
}, false);
// Replacement:
const view = await imodel.getSchemaView();
for (const property of view.findClass("BisCore:Element")?.getProperties() ?? []) {
console.log(`Property name: ${property.name}, Kind: ${property.kind}`);
}
| Parameter | Type | Description |
|---|---|---|
| iModel | IModelDb | The IModel that contains the schema |
| classFullName | string | The full class name to load the metadata, if necessary |
| wantSuper | boolean | If true, superclass properties will also be processed |
| func | PropertyCallback | The callback to be invoked on each property |
| includeCustom | boolean | If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties. |
Returns - void
Defined in
- backend/src/IModelDb.ts Line 1931
Last Updated: 08 June, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.