Skip to content

Commit

Permalink
Update images on README.md (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaxovaiko authored Nov 10, 2023
1 parent c1f0cb8 commit 27d6415
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ import { build } from "sparrowql";

Imagine you have a simple db model:
<br>
![Simple graph db model](graph.png)

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/vazco/sparrowql/assets/34129845/dea5e803-1f48-4f46-987e-685b516485ad">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/vazco/sparrowql/assets/34129845/0c787c45-eb89-49e9-acd1-dbcbf314b861">
<img alt="Simple db graph model" src="https://github.com/vazco/sparrowql/assets/34129845/0c787c45-eb89-49e9-acd1-dbcbf314b861">
</picture>

And a some fixtures for it:

Expand Down Expand Up @@ -141,7 +146,11 @@ const results = await Posts.aggregate(pipeline).toArray();

SparrowQL works correctly only on [directed trees](<https://en.wikipedia.org/wiki/Tree_(graph_theory)>) - in this case, you want to create a _query which takes all the posts that were posted on someone's blog and the name of the blog owner_. To make it work, you need to use **aliases**. Here is an example:

![Simple db graph model with aliases](tree.png)
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/vazco/sparrowql/assets/34129845/a20304fb-0d98-4756-a76b-74544980a574">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/vazco/sparrowql/assets/34129845/06c81bdd-70a9-42d4-9ed9-b9e3e53f3bcd">
<img alt="Simple db graph model with aliases" src="https://github.com/vazco/sparrowql/assets/34129845/06c81bdd-70a9-42d4-9ed9-b9e3e53f3bcd">
</picture>

The only thing to do is to create aliases:

Expand Down
Binary file removed graph.png
Binary file not shown.
Binary file removed tree.png
Binary file not shown.

0 comments on commit 27d6415

Please sign in to comment.