Skip to content

Commit

Permalink
Merge pull request #68 from Serpico1899/main
Browse files Browse the repository at this point in the history
📝 add getPureModel document(api reference)
  • Loading branch information
hemedani authored Jan 12, 2024
2 parents 0282164 + 5acfb90 commit 688446d
Showing 1 changed file with 80 additions and 2 deletions.
82 changes: 80 additions & 2 deletions pages/src/api/schemas/pureFns/getPureModel_Fns.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,82 @@
# getPureModel

get pure features of one schema
@param name - name of schema that we want to get pure feature
```ts
getPureModel: (name: string)
```

_Get pure features of one schema_

</br>

<details open>
<summary>
Example
</summary>
<pre>
<code class="language-ts" style="padding: 0;">
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",
},
},
},
},
},
);
<p style="border: 2px solid gray; border-right: transparent; border-left: transparent; padding: 5px 1rem; background-color: #000000" >const getCityPureModel = coreApp.schemas.getPureModel("city");</p>
</code>
</pre>
</details>

<details>
<summary>
Return Of Example
</summary>
<pre>
<code class="language-json" style="padding: 0;">
{
"_id": {
"type": "union",
"schema": null
},
"name": {
"type": "string",
"schema": null
},
"population": {
"type": "number",
"schema": null
},
"abb": {
"type": "string",
"schema": null
}
}
</code>
</pre>
</details>

<h3>Parameters</h3>
<pre>
<code class="language-ts" style="padding: 0; margin-top: 12px; margin-top: -18px;">
name: string
</code>
</pre>

0 comments on commit 688446d

Please sign in to comment.