-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refaction action follow/unfollow (#89)
* fixed followers get query * init slices in user entity * implement action follow / unfollow
- Loading branch information
1 parent
2f2c683
commit 22d900d
Showing
7 changed files
with
53 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
/* N1QL query to retrieve user followers for an anonymous user. */ | ||
|
||
SELECT RAW { | ||
"id": META(p).id, | ||
"username": p.`username`, | ||
"member_since": p.`member_since`, | ||
"follow": false | ||
"id": META(p).id, | ||
"username": p.`username`, | ||
"member_since": p.`member_since`, | ||
"follow": FALSE | ||
} | ||
FROM | ||
`bucket_name` p | ||
USE KEYS [( | ||
SELECT | ||
RAW u.`followers` | ||
FROM | ||
`bucket_name` u | ||
USE KEYS $user | ||
)[0]] | ||
FROM `bucket_name` p USE KEYS [( | ||
SELECT RAW ARRAY LOWER(u.username) FOR u IN s.`followers` END | ||
FROM `bucket_name` s USE KEYS $user )[0]] | ||
OFFSET $offset | ||
LIMIT | ||
$limit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters