getMainRelations
getMainRelations: (schemaName: string)
Get all of inerRealation of one schema
Example
const coreApp = lesan();
const locationPure = {
name: string(),
population: number(),
abb: string(),
};
const cities = coreApp.odm.newModel(
"city",
locationPure,
{
country: {
schemaName: "country",
type: "single",
optional: false,
relatedRelations: {
cities: {
type: "multiple",
limit: 5,
sort: {
field: "_id",
order: "asc",
},
},
},
},
},
);
const getCityMainRelations = coreApp.schemas.getMainRelations("city");
Return Of Example
{
"country": {
"schemaName": "country",
"type": "single",
"optional": false
}
}
Parameters
schemaName: string