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

Update images on README.md #42

Merged
merged 7 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
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
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.
Loading