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

'Must have one or two primary key attributes' when hash and range key defined #24

Open
mlcloudsec opened this issue Mar 30, 2016 · 0 comments

Comments

@mlcloudsec
Copy link

So let's say we have a model definition like this:

`{

identity: 'modelA',

connection: 'dynamoA',

tableName: 'tableA',

attributes: {

    fieldA: {
        type: 'integer',
        primaryKey: 'hash'
    },

    fieldB: {
        type: 'string',
        primaryKey: 'range'
    }
}

}`

The adapter throws 'Must have one or two primary key attributes' because the primaryKeys in the collection.definition is counting the hash and range primary keys and also an id field like so:

`
id: {
type: 'string',
primaryKey: true,
unique: true,
defaultsTo: [Function]
}

`
This happens to be true even with autoPK:false.
Suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant