DynamoDB : How to query multiple partition key ordered by sort key on GSIWhich hash key is best for event data in DynamoDB?Is Composite Primary Key in DynamoDB for QueryAWS Dynamodb: Is it possible to make a query only using sort keyOrder in which data is stored for same GSI values in a DynamoDB table which does not have a range key over GSIDynamoDB selecting by date GSI write unitsDynamoDB partition key choice for notes appHow to use GSI in dynamodb?DynamoDB: Best hash/sort keys for my use case [confusion with AppSync/GraphQL]DynamoDB equivalent to find().sort()DynamoDB Not Sorting by Sort Key
How to laser-level close to a surface
Have the writers and actors of GOT responded to its poor reception?
Show that the characteristic polynomial is the same as the minimal polynomial
Why does the U.S military use mercenaries?
Was Tyrion always a poor strategist?
Number Sequence Series-Question 2
Merging two rows with rounding their first elemnts
Does the usage of mathematical symbols work differently in books than in theses?
Why does string strummed with finger sound different from the one strummed with pick?
Would it be fair to use 1d30 (instead of rolling 2d20 and taking the higher die) for advantage rolls?
Parse a C++14 integer literal
At what point can a confirmation be established between words of similar meaning in context?
Managing heat dissipation in a magic wand
Is there any deeper thematic meaning to the white horse that Arya finds in The Bells (S08E05)?
How to customize the pie chart background in PowerPoint?
Pedaling at different gear ratios on flat terrain: what's the point?
How do I balance a campaign consisting of four kobold PCs?
Would a "ring language" be possible?
How to say "that" as in "the cow that ate" in Japanese?
Is it a good idea to teach algorithm courses using pseudocode instead of a real programming language?
how to create an executable file for an AppleScript?
Have GoT's showrunners reacted to the poor reception of the final season?
Windows reverting changes made by Linux to FAT32 partion
Why do academics prefer Mac/Linux?
DynamoDB : How to query multiple partition key ordered by sort key on GSI
Which hash key is best for event data in DynamoDB?Is Composite Primary Key in DynamoDB for QueryAWS Dynamodb: Is it possible to make a query only using sort keyOrder in which data is stored for same GSI values in a DynamoDB table which does not have a range key over GSIDynamoDB selecting by date GSI write unitsDynamoDB partition key choice for notes appHow to use GSI in dynamodb?DynamoDB: Best hash/sort keys for my use case [confusion with AppSync/GraphQL]DynamoDB equivalent to find().sort()DynamoDB Not Sorting by Sort Key
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm currently developing an Instagram clone using dynamoDB and appSync as back-end.
Im currently working on the user's feed page. I need to query all posts by the user and the users he follows ordered by timestamp.
I created a GSI with userId as partition key and timestamp as sort key.
I tried:
- "Query" on GSI, but it allow only one partition key
- "Scan" on the GSI then filter on userId, but it doesn't order posts by timestamp
- "BatchGet", but it doesn't order posts by timestamp, and the result is not flatten
Post Attributes:
type:"POST",
id:"post1",
timeStamp:"213213123",
img_url: "https://img.com/img.jpg",
userComment:"nice pic",
userId:"user1",
userName:"kevin",
numberOfComment:"0",
numberOfLike:"0
User attribute:
type:"USER",
id:"user1",
userName:"Kevin",
FollowerCount:0,
FollowCount:0,
PostCount:1,
bio:"bio"
Is there another solution?
edit: my dynamodbTable
amazon-web-services nosql amazon-dynamodb graphql aws-appsync
add a comment |
I'm currently developing an Instagram clone using dynamoDB and appSync as back-end.
Im currently working on the user's feed page. I need to query all posts by the user and the users he follows ordered by timestamp.
I created a GSI with userId as partition key and timestamp as sort key.
I tried:
- "Query" on GSI, but it allow only one partition key
- "Scan" on the GSI then filter on userId, but it doesn't order posts by timestamp
- "BatchGet", but it doesn't order posts by timestamp, and the result is not flatten
Post Attributes:
type:"POST",
id:"post1",
timeStamp:"213213123",
img_url: "https://img.com/img.jpg",
userComment:"nice pic",
userId:"user1",
userName:"kevin",
numberOfComment:"0",
numberOfLike:"0
User attribute:
type:"USER",
id:"user1",
userName:"Kevin",
FollowerCount:0,
FollowCount:0,
PostCount:1,
bio:"bio"
Is there another solution?
edit: my dynamodbTable
amazon-web-services nosql amazon-dynamodb graphql aws-appsync
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
1
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05
add a comment |
I'm currently developing an Instagram clone using dynamoDB and appSync as back-end.
Im currently working on the user's feed page. I need to query all posts by the user and the users he follows ordered by timestamp.
I created a GSI with userId as partition key and timestamp as sort key.
I tried:
- "Query" on GSI, but it allow only one partition key
- "Scan" on the GSI then filter on userId, but it doesn't order posts by timestamp
- "BatchGet", but it doesn't order posts by timestamp, and the result is not flatten
Post Attributes:
type:"POST",
id:"post1",
timeStamp:"213213123",
img_url: "https://img.com/img.jpg",
userComment:"nice pic",
userId:"user1",
userName:"kevin",
numberOfComment:"0",
numberOfLike:"0
User attribute:
type:"USER",
id:"user1",
userName:"Kevin",
FollowerCount:0,
FollowCount:0,
PostCount:1,
bio:"bio"
Is there another solution?
edit: my dynamodbTable
amazon-web-services nosql amazon-dynamodb graphql aws-appsync
I'm currently developing an Instagram clone using dynamoDB and appSync as back-end.
Im currently working on the user's feed page. I need to query all posts by the user and the users he follows ordered by timestamp.
I created a GSI with userId as partition key and timestamp as sort key.
I tried:
- "Query" on GSI, but it allow only one partition key
- "Scan" on the GSI then filter on userId, but it doesn't order posts by timestamp
- "BatchGet", but it doesn't order posts by timestamp, and the result is not flatten
Post Attributes:
type:"POST",
id:"post1",
timeStamp:"213213123",
img_url: "https://img.com/img.jpg",
userComment:"nice pic",
userId:"user1",
userName:"kevin",
numberOfComment:"0",
numberOfLike:"0
User attribute:
type:"USER",
id:"user1",
userName:"Kevin",
FollowerCount:0,
FollowCount:0,
PostCount:1,
bio:"bio"
Is there another solution?
edit: my dynamodbTable
amazon-web-services nosql amazon-dynamodb graphql aws-appsync
amazon-web-services nosql amazon-dynamodb graphql aws-appsync
edited Mar 23 at 19:56
Riki Chou
asked Mar 23 at 17:35
Riki ChouRiki Chou
868
868
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
1
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05
add a comment |
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
1
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
1
1
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316529%2fdynamodb-how-to-query-multiple-partition-key-ordered-by-sort-key-on-gsi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316529%2fdynamodb-how-to-query-multiple-partition-key-ordered-by-sort-key-on-gsi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How many tables you have. 2 ? u probably need to add your table details.
– syadav
Mar 23 at 18:41
1
Worth reading the blog post at aws.amazon.com/blogs/database/…, particularly the chat message app example.
– jarmod
Mar 23 at 20:02
I have only one Table. I can fetch all posts by userId with by querying the userId-timeStamp-index
– Riki Chou
Mar 23 at 20:05