getPureOfMainRelations

 getPureOfMainRelations: (schemaName: keyof TSchemas)

Extract pure feature of inrelations 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 getCityPureOfMainRelations = coreApp.schemas.getPureOfMainRelations("city");

Return Of Example
    
      {
      "_id": {
        "type": "union",
        "schema": null
      },
      "name": {
        "type": "string",
        "schema": null
      },
      "population": {
        "type": "number",
        "schema": null
      },
      "abb": {
        "type": "string",
        "schema": null
      },
      "country": {
        "type": "object",
        "schema": {
          "_id": {
            "type": "union",
            "schema": null
          },
          "name": {
            "type": "string",
            "schema": null
          },
          "population": {
            "type": "number",
            "schema": null
          },
          "abb": {
            "type": "string",
            "schema": null
          }
        }
      }
    }
    
  

Parameters

  
  schemaName: keyof TSchemas