Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes part of composite keys are not returned #38

Closed
aldebout opened this issue May 5, 2020 · 3 comments
Closed

Attributes part of composite keys are not returned #38

aldebout opened this issue May 5, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@aldebout
Copy link

aldebout commented May 5, 2020

I've got an entity with the following attributes:

attributes: {
        pk: {
          type: 'string',
          partitionKey: true,
        },
        sk: {
          sortKey: true,
          hidden: true,
        },
        username: ['sk', 1, { save: true }],
        role: ['sk', 0],
      },

According to the doc, I should get both username and role when querying this entity.
However, I only get the username (which is saved).

The quick fix is easy but I thought I'd report it so that you could fix it or update the doc.

@jeremydaly jeremydaly added the bug Something isn't working label May 5, 2020
@jeremydaly
Copy link
Owner

Thanks @aldebout. I have some work to do on the composite key stuff. The interface needs to be a bit more flexible.

@jeremydaly
Copy link
Owner

I've made some changes to the composite key generation and parsing. Please gives this a try again and let me know if it works.

I did make a change so that all attributes are saved by default, since this is a recommended practice. You can disable it by setting save: false.

@aldebout
Copy link
Author

aldebout commented May 8, 2020

It's looking good, I'll check it out! I might have to fix a few lines in my codebase around the type -> entity change before that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants