Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 add getMainRelations document(api reference) #74

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 67 additions & 2 deletions pages/src/api/schemas/mainRelationsFns/getMainRelations_fn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# getMainRelations

get all of inerRealation of one schema
```ts
getMainRelations: (schemaName: string)
```

@param schemaName - name of schema that we want inerRealation of it
_Get all of inerRealation 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 getCityMainRelations = coreApp.schemas.getMainRelations("city");</p>
</code>
</pre>
</details>

<details>
<summary>
Return Of Example
</summary>
<pre>
<code class="language-json" style="padding: 0;">
{
"country": {
"schemaName": "country",
"type": "single",
"optional": false
}
}
</code>
</pre>
</details>

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