From 589e2bd05ec92f24bca97e7e4f9972250e421016 Mon Sep 17 00:00:00 2001 From: "Sinan Sonmez (Chaush)" Date: Sat, 30 Jul 2022 11:29:23 +0000 Subject: [PATCH] Query to select only certain fields --- website/๐Ÿ”Œ Query.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/website/๐Ÿ”Œ Query.md b/website/๐Ÿ”Œ Query.md index 4adb6b9..c32c118 100644 --- a/website/๐Ÿ”Œ Query.md +++ b/website/๐Ÿ”Œ Query.md @@ -86,9 +86,9 @@ Our goal in this exercise is to (i) get all plug pages (ii) ordered by last modi For the sake of simplicity, we will use `page` data source and limit the results not to spoil the page. #### 5.1 Simple query without any condition -We would like to get the list of all pages. +**Goal:** We would like to get the list of all pages. -Look at the data. This is more than we need. The query even gives us template pages. Lets try to limit it in the next step +**Result:** Look at the data. This is more than we need. The query even gives us template pages. Lets try to limit it in the next step |name |lastModified |perm|tags |type|uri |repo |author | |--|--|--|--|--|--|--|--| @@ -105,15 +105,34 @@ Look at the data. This is more than we need. The query even gives us template pa #### 5.2 Simple query without a condition -We would like to get all plug pages and sorted by last modified time +**Goal:** We would like to get all plug pages and sorted by last modified time + +**Result:** Okay, this what we wanted but there are also information such as perm, type and lastModified that we don't want to show in the page |name |lastModified |perm|type|uri |repo |author | |--|--|--|--|--|--|--| -|๐Ÿ”Œ Query |1659180237743|rw|plug|core:query |https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors| +|๐Ÿ”Œ Query |1659180321311|rw|plug|core:query |https://github.com/silverbulletmd/silverbullet |Silver Bullet Authors| |๐Ÿ”Œ Mattermost|1659111156000|rw|plug|github:silverbulletmd/silverbullet-mattermost/mattermost.plug.json|https://github.com/silverbulletmd/silverbullet-mattermost|Zef Hemel | |๐Ÿ”Œ Backlinks |1659108035000|rw|plug|ghr:Willyfrog/silverbullet-backlinks |https://github.com/Willyfrog/silverbullet-backlinks |Guillermo Vayรก | |๐Ÿ”Œ Ghost |1659108035000|rw|plug|github:silverbulletmd/silverbullet-ghost/ghost.plug.json |https://github.com/silverbulletmd/silverbullet-ghost |Zef Hemel | |๐Ÿ”Œ Git |1659108035000|rw|plug|github:silverbulletmd/silverbullet-github/github.plug.json |https://github.com/silverbulletmd/silverbullet-github |Zef Hemel | + +#### 5.3 Query to select only certain fields +**Goal:** We would like to get all plug pages, select only `name` and `uri` column and sort by last modified time and + +**Result:** Okay, this is much better. However, I believe this needs a touch from a visual perspective + + +|name |uri | +|--|--| +|๐Ÿ”Œ Query |core:query | +|๐Ÿ”Œ Mattermost|github:silverbulletmd/silverbullet-mattermost/mattermost.plug.json| +|๐Ÿ”Œ Backlinks |ghr:Willyfrog/silverbullet-backlinks | +|๐Ÿ”Œ Ghost |github:silverbulletmd/silverbullet-ghost/ghost.plug.json | +|๐Ÿ”Œ Git |github:silverbulletmd/silverbullet-github/github.plug.json | + + +#### 5.4 Query to select only certain fields \ No newline at end of file