Skip to content

Commit

Permalink
πŸ“ Merge pull request #45 from hemedani/main
Browse files Browse the repository at this point in the history
πŸ“ add some new doc about relation
  • Loading branch information
hemedani authored Jan 6, 2024
2 parents c34188c + 48df622 commit 834f4a5
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h1 id="installation"><a class="header" href="#installation">Installation</a></h
<p>Currently, only the <a href="https://deno.land/">Deno</a> version of <strong>Lesan's</strong> framework is ready and usable, <a href="https://nodejs.org/en">Node</a> and <a href="https://bun.sh/">Bun</a> versions will also be ready soon.</p>
<h3 id="pre-request"><a class="header" href="#pre-request">Pre request</a></h3>
<ul>
<li>At least version 6 of <a href="https://www.mongodb.com/docs/manual/installation/">MongoDB</a> must be installed.</li>
<li>At least version 7 of <a href="https://www.mongodb.com/docs/manual/installation/">MongoDB</a> must be installed.</li>
<li>The latest version of <a href="https://docs.deno.com/runtime/manual/getting_started/installation">Deno</a> must be installed.</li>
<li>It is good to have <a href="https://nodejs.org/en/download">NodeJS</a> installed on your system.</li>
<li>If you need to see database information, it is better to install <a href="https://www.mongodb.com/docs/compass/current/install/">MongoDB Compass</a>.</li>
Expand Down
24 changes: 23 additions & 1 deletion docs/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h1 id="benchmarks"><a class="header" href="#benchmarks">Benchmarks</a></h1>
<p>Currently, only the <a href="https://deno.land/">Deno</a> version of <strong>Lesan's</strong> framework is ready and usable, <a href="https://nodejs.org/en">Node</a> and <a href="https://bun.sh/">Bun</a> versions will also be ready soon.</p>
<h3 id="pre-request"><a class="header" href="#pre-request">Pre request</a></h3>
<ul>
<li>At least version 6 of <a href="https://www.mongodb.com/docs/manual/installation/">MongoDB</a> must be installed.</li>
<li>At least version 7 of <a href="https://www.mongodb.com/docs/manual/installation/">MongoDB</a> must be installed.</li>
<li>The latest version of <a href="https://docs.deno.com/runtime/manual/getting_started/installation">Deno</a> must be installed.</li>
<li>It is good to have <a href="https://nodejs.org/en/download">NodeJS</a> installed on your system.</li>
<li>If you need to see database information, it is better to install <a href="https://www.mongodb.com/docs/compass/current/install/">MongoDB Compass</a>.</li>
Expand Down Expand Up @@ -2307,8 +2307,30 @@ <h4 id="configdata-e2e-file"><a class="header" href="#configdata-e2e-file">Confi
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/44dd6ccd-de32-4457-9fb5-5e006b54142d" alt="Screenshot 2024-01-04 at 20-27-19 Lesan Playground" /></p>
</li>
</ol>
<p>After clicking the <code>run E2E test</code> button, you will go to the test results page.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/123c7303-d100-4009-9395-f97c68683579" alt="Screenshot 2024-01-06 at 13-34-30 Lesan Playground" /></p>
<p>If you scroll down a little, you can see the results of each sequence separately:
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/db59ef98-b30f-4a39-8204-dc696dbd31fa" alt="Screenshot 2024-01-06 at 14-13-04 Lesan Playground" />
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/577dd55a-8faa-4686-ad8a-4de62671c490" alt="Screenshot 2024-01-06 at 14-20-03 Lesan Playground" /></p>
<ol>
<li>with this button you can change view of panel from <code>body-header &amp; Description</code> to <code>REQUEST &amp; RESULT</code></li>
<li>show some description about sequence including request number &amp; timing, captured value and so on.</li>
<li>show unparsed <code>header</code> and <code>body</code> you send to the backend.</li>
<li>show the <code>index</code> of each sequence.</li>
<li>show <code>response</code> get back from server.</li>
<li>show parsed request you send to server, including parsed <code>header</code> and <code>body</code>.</li>
<li>pagination for sequence with more than 1 request.</li>
</ol>
<p>After finished executing all test in <code>configdata.json</code> you have a nice data inserted to <code>sample</code> collection in mongodb.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/ca01c001-7dd9-4b99-a5d5-82ab39ee008d" alt="Screenshot from 2024-01-06 15-10-49" /></p>
<p>You can play with this data in <code>playground</code> and change everything you want.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/4efa9e8a-ba9b-40f0-8ebe-6d5ed139fee3" alt="Screenshot 2024-01-06 at 15-08-36 Lesan Playground" /></p>
<h2 id="all-relationship-sweets-in-lesan"><a class="header" href="#all-relationship-sweets-in-lesan">All relationship sweets in Lesan</a></h2>
<p>shoma tanha ba fieldhaye pure yek schema sar o kar darid va modiriat rabeteha tamaman be sorat khodkar tavasot lesan anjam mishavad.
shoma mitavanid bar asas rabeteye yek schema an ra sort ya filter konid
shoma baraye daryaft dadaha ba queryhaye pichide asnad besiyar kamtari ra az database jamavari mikonid. (link bedam be tozihat kamel)</p>
<h2 id="all-relationship-bitterness-in-lesan"><a class="header" href="#all-relationship-bitterness-in-lesan">All relationship bitterness in Lesan</a></h2>
<p>barkhi az rabeteha baes eijad updatehaye besiyar bozorg mishavand. rah hal: 1-eijad rabeteye jadid 2-qq 3-in-memory db</p>
<p>Ψ§ΩˆΩ„ Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ…Ϊ©Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡ Ϊ†ΫŒ Ω‡Ψ³Ψͺ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω…ΨŒ Ψ¨ΨΉΨ― Ω…ΫŒβ€ŒΪ―Ω… Ψ§Ψ³β€ŒΪ©ΫŒΩˆΨ§Ω„ فقط Ϊ©Ψ§Ω†Ϊ©Ψ΄Ω† Ψ¨Ψ±Ω‚Ψ±Ψ§Ψ± Ω…ΫŒβ€ŒΪ©Ω†Ω‡ΨŒ Ψ¨ΨΉΨ― Ω…ΫŒβ€ŒΪ―Ω… Ω†ΩˆΨ§Ψ³β€ŒΪ©ΫŒΩˆΨ§Ω„ Ω‡Ω… فقط Ψ§Ω…Ψ¨Ψ― Ω…ΫŒβ€ŒΪ©Ω†Ω‡ و Ω…Ψ―ΫŒΨ±ΫŒΨͺ Ψ―Ψ±Ψ³Ψͺ Ω†Ψ―Ψ§Ψ±Ω‡.</p>
<p>Ψ¨ΨΉΨ― Ω…ΫŒΨ§Ω… Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ†Ϊ©Ω‡ Ω‡Ψ± ΩΫŒΩ„Ψ― ΩΎΨ± Ψͺغییری Ω…ΫŒβ€ŒΨͺΩˆΩ†Ω‡ Ψ¨Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡ ΨͺΨ¨Ψ―ΫŒΩ„ Ψ¨Ψ΄Ω‡ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω…ΨŒ Ω…Ψ«Ψ§Ω„ Ψ¨Ψ§Ω†Ϊ© و Ψ«Ψ¨Ψͺ Ψ§Ψ­ΩˆΨ§Ω„ Ϊ©Ψ΄ΩˆΨ±Ω‡Ψ§ رو Ω…ΫŒβ€ŒΪ―Ω….</p>
<p>Ψ¨ΨΉΨ― Ω…ΫŒΨ§Ω… Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ†Ϊ©Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡β€ŒΩ‡Ψ§ΫŒ دو Ψ³Ψ± Ϊ†Ω†Ψ―Ψͺایی Ω†Ω…ΫŒβ€ŒΨͺΩˆΩ†Ω‡ دو Ψ³Ψ± بی Ψ§Ω†ΨͺΩ‡Ψ§ Ψ―Ψ§Ψ΄ΨͺΩ‡ Ψ¨Ψ§Ψ΄Ω‡ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω… و Ϊ†Ω†Ψ―ΨͺΨ§ Ω…Ψ«Ψ§Ω„ Ω…ΫŒβ€ŒΨ²Ω†Ω….</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.json

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions docs/what_is_the_relationship.html
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,30 @@ <h4 id="configdata-e2e-file"><a class="header" href="#configdata-e2e-file">Confi
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/44dd6ccd-de32-4457-9fb5-5e006b54142d" alt="Screenshot 2024-01-04 at 20-27-19 Lesan Playground" /></p>
</li>
</ol>
<p>After clicking the <code>run E2E test</code> button, you will go to the test results page.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/123c7303-d100-4009-9395-f97c68683579" alt="Screenshot 2024-01-06 at 13-34-30 Lesan Playground" /></p>
<p>If you scroll down a little, you can see the results of each sequence separately:
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/db59ef98-b30f-4a39-8204-dc696dbd31fa" alt="Screenshot 2024-01-06 at 14-13-04 Lesan Playground" />
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/577dd55a-8faa-4686-ad8a-4de62671c490" alt="Screenshot 2024-01-06 at 14-20-03 Lesan Playground" /></p>
<ol>
<li>with this button you can change view of panel from <code>body-header &amp; Description</code> to <code>REQUEST &amp; RESULT</code></li>
<li>show some description about sequence including request number &amp; timing, captured value and so on.</li>
<li>show unparsed <code>header</code> and <code>body</code> you send to the backend.</li>
<li>show the <code>index</code> of each sequence.</li>
<li>show <code>response</code> get back from server.</li>
<li>show parsed request you send to server, including parsed <code>header</code> and <code>body</code>.</li>
<li>pagination for sequence with more than 1 request.</li>
</ol>
<p>After finished executing all test in <code>configdata.json</code> you have a nice data inserted to <code>sample</code> collection in mongodb.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/ca01c001-7dd9-4b99-a5d5-82ab39ee008d" alt="Screenshot from 2024-01-06 15-10-49" /></p>
<p>You can play with this data in <code>playground</code> and change everything you want.
<img src="https://github.com/MiaadTeam/lesan/assets/6236123/4efa9e8a-ba9b-40f0-8ebe-6d5ed139fee3" alt="Screenshot 2024-01-06 at 15-08-36 Lesan Playground" /></p>
<h2 id="all-relationship-sweets-in-lesan"><a class="header" href="#all-relationship-sweets-in-lesan">All relationship sweets in Lesan</a></h2>
<p>shoma tanha ba fieldhaye pure yek schema sar o kar darid va modiriat rabeteha tamaman be sorat khodkar tavasot lesan anjam mishavad.
shoma mitavanid bar asas rabeteye yek schema an ra sort ya filter konid
shoma baraye daryaft dadaha ba queryhaye pichide asnad besiyar kamtari ra az database jamavari mikonid. (link bedam be tozihat kamel)</p>
<h2 id="all-relationship-bitterness-in-lesan"><a class="header" href="#all-relationship-bitterness-in-lesan">All relationship bitterness in Lesan</a></h2>
<p>barkhi az rabeteha baes eijad updatehaye besiyar bozorg mishavand. rah hal: 1-eijad rabeteye jadid 2-qq 3-in-memory db</p>
<p>Ψ§ΩˆΩ„ Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ…Ϊ©Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡ Ϊ†ΫŒ Ω‡Ψ³Ψͺ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω…ΨŒ Ψ¨ΨΉΨ― Ω…ΫŒβ€ŒΪ―Ω… Ψ§Ψ³β€ŒΪ©ΫŒΩˆΨ§Ω„ فقط Ϊ©Ψ§Ω†Ϊ©Ψ΄Ω† Ψ¨Ψ±Ω‚Ψ±Ψ§Ψ± Ω…ΫŒβ€ŒΪ©Ω†Ω‡ΨŒ Ψ¨ΨΉΨ― Ω…ΫŒβ€ŒΪ―Ω… Ω†ΩˆΨ§Ψ³β€ŒΪ©ΫŒΩˆΨ§Ω„ Ω‡Ω… فقط Ψ§Ω…Ψ¨Ψ― Ω…ΫŒβ€ŒΪ©Ω†Ω‡ و Ω…Ψ―ΫŒΨ±ΫŒΨͺ Ψ―Ψ±Ψ³Ψͺ Ω†Ψ―Ψ§Ψ±Ω‡.</p>
<p>Ψ¨ΨΉΨ― Ω…ΫŒΨ§Ω… Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ†Ϊ©Ω‡ Ω‡Ψ± ΩΫŒΩ„Ψ― ΩΎΨ± Ψͺغییری Ω…ΫŒβ€ŒΨͺΩˆΩ†Ω‡ Ψ¨Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡ ΨͺΨ¨Ψ―ΫŒΩ„ Ψ¨Ψ΄Ω‡ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω…ΨŒ Ω…Ψ«Ψ§Ω„ Ψ¨Ψ§Ω†Ϊ© و Ψ«Ψ¨Ψͺ Ψ§Ψ­ΩˆΨ§Ω„ Ϊ©Ψ΄ΩˆΨ±Ω‡Ψ§ رو Ω…ΫŒβ€ŒΪ―Ω….</p>
<p>Ψ¨ΨΉΨ― Ω…ΫŒΨ§Ω… Ψ±Ψ§Ψ¬ΨΉ Ψ¨Ω‡ Ψ§ΫŒΩ†Ϊ©Ω‡ Ψ±Ψ§Ψ¨Ψ·Ω‡β€ŒΩ‡Ψ§ΫŒ دو Ψ³Ψ± Ϊ†Ω†Ψ―Ψͺایی Ω†Ω…ΫŒβ€ŒΨͺΩˆΩ†Ω‡ دو Ψ³Ψ± بی Ψ§Ω†ΨͺΩ‡Ψ§ Ψ―Ψ§Ψ΄ΨͺΩ‡ Ψ¨Ψ§Ψ΄Ω‡ حرف Ω…ΫŒβ€ŒΨ²Ω†Ω… و Ϊ†Ω†Ψ―ΨͺΨ§ Ω…Ψ«Ψ§Ω„ Ω…ΫŒβ€ŒΨ²Ω†Ω….</p>
Expand Down
2 changes: 1 addition & 1 deletion pages/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Currently, only the [Deno](https://deno.land/) version of **Lesan's** framework is ready and usable, [Node](https://nodejs.org/en) and [Bun](https://bun.sh/) versions will also be ready soon.

### Pre request
- At least version 6 of [MongoDB](https://www.mongodb.com/docs/manual/installation/) must be installed.
- At least version 7 of [MongoDB](https://www.mongodb.com/docs/manual/installation/) must be installed.
- The latest version of [Deno](https://docs.deno.com/runtime/manual/getting_started/installation) must be installed.
- It is good to have [NodeJS](https://nodejs.org/en/download) installed on your system.
- If you need to see database information, it is better to install [MongoDB Compass](https://www.mongodb.com/docs/compass/current/install/).
Expand Down
25 changes: 24 additions & 1 deletion pages/src/what_is_the_relationship.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,34 @@ Let us see all the parts of this E2E test one by one (The point is that in almos
39. update a user with `main` β†’ `user` β†’ `updateUser`:
![Screenshot 2024-01-04 at 20-27-19 Lesan Playground](https://github.com/MiaadTeam/lesan/assets/6236123/44dd6ccd-de32-4457-9fb5-5e006b54142d)

After clicking the `run E2E test` button, you will go to the test results page.
![Screenshot 2024-01-06 at 13-34-30 Lesan Playground](https://github.com/MiaadTeam/lesan/assets/6236123/123c7303-d100-4009-9395-f97c68683579)

If you scroll down a little, you can see the results of each sequence separately:
![Screenshot 2024-01-06 at 14-13-04 Lesan Playground](https://github.com/MiaadTeam/lesan/assets/6236123/db59ef98-b30f-4a39-8204-dc696dbd31fa)
![Screenshot 2024-01-06 at 14-20-03 Lesan Playground](https://github.com/MiaadTeam/lesan/assets/6236123/577dd55a-8faa-4686-ad8a-4de62671c490)
1. with this button you can change view of panel from `body-header & Description` to `REQUEST & RESULT`
2. show some description about sequence including request number & timing, captured value and so on.
3. show unparsed `header` and `body` you send to the backend.
4. show the `index` of each sequence.
5. show `response` get back from server.
6. show parsed request you send to server, including parsed `header` and `body`.
7. pagination for sequence with more than 1 request.

After finished executing all test in `configdata.json` you have a nice data inserted to `sample` collection in mongodb.
![Screenshot from 2024-01-06 15-10-49](https://github.com/MiaadTeam/lesan/assets/6236123/ca01c001-7dd9-4b99-a5d5-82ab39ee008d)

You can play with this data in `playground` and change everything you want.
![Screenshot 2024-01-06 at 15-08-36 Lesan Playground](https://github.com/MiaadTeam/lesan/assets/6236123/4efa9e8a-ba9b-40f0-8ebe-6d5ed139fee3)


## All relationship sweets in Lesan
shoma tanha ba fieldhaye pure yek schema sar o kar darid va modiriat rabeteha tamaman be sorat khodkar tavasot lesan anjam mishavad.
shoma mitavanid bar asas rabeteye yek schema an ra sort ya filter konid
shoma baraye daryaft dadaha ba queryhaye pichide asnad besiyar kamtari ra az database jamavari mikonid. (link bedam be tozihat kamel)

## All relationship bitterness in Lesan

barkhi az rabeteha baes eijad updatehaye besiyar bozorg mishavand. rah hal: 1-eijad rabeteye jadid 2-qq 3-in-memory db



Expand Down
2 changes: 1 addition & 1 deletion src/npmDeps.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "npm:[email protected]";
export * from "npm:mongodb@6.1.0";
export * from "npm:mongodb@6.3.0";
8 changes: 4 additions & 4 deletions src/odm/relation/addRelation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const addRelation = async <TR extends IRelationsFileds>({
}

// first remove previus relatedRelation
if (foundedDoc![rel]) {
if (foundedDoc && foundedDoc[rel]) {
// first remove previus relatedRelation
await processRemoveRelatedRelations({
db,
Expand All @@ -74,12 +74,12 @@ export const addRelation = async <TR extends IRelationsFileds>({
foundedDocPureProjection,
foundedSchema,
collection,
prevRelationDoc: foundedDoc![rel],
prevRelationDoc: foundedDoc[rel],
removeDoc: filterDocByProjection(
foundedDoc!,
foundedDoc,
pureDocProjection,
),
relDocForUpdate: foundedDoc![rel]._id,
relDocForUpdate: foundedDoc[rel]._id,
});
}

Expand Down

0 comments on commit 834f4a5

Please sign in to comment.