Comments (3)
Yep, that's exactly right! And it's a good point -- the begins_with()
would be a little safer there :)
from graphql-dynamodb-single-table.
Hey @Nr18, thanks for reaching out.
There are a few ways we could write this, but this should work. My key condition expression is specifying items whose SK is less than (<) the SITE#${domain}
sort key, so it will exclude the Site object whose sort key is exactly that.
Let me know if you think I'm still wrong! Taking a quick glance at it but I think it should be correct :)
from graphql-dynamodb-single-table.
Ah right so because the P
comes before the S
in the alphabet it is smaller and thus the posts are fetched. Is that assumption correct?
So if that is correct and you would introduce AUTHOR#{id}
in the same partition those would also be fetched as a side effect of this query. Therefor I would personally use the begins_with(SK, :sk)
and alter the :sk
too POST#
. This way you guarantee that you are only fetching posts in the getPostsForSite
call.
from graphql-dynamodb-single-table.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-dynamodb-single-table.