Code Monkey home page Code Monkey logo

Comments (3)

alexdebrie avatar alexdebrie commented on May 29, 2024 1

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.

alexdebrie avatar alexdebrie commented on May 29, 2024

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.

Nr18 avatar Nr18 commented on May 29, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.