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

Unique not work #39

Open
DiogoMachadoMarques opened this issue Mar 20, 2017 · 2 comments
Open

Unique not work #39

DiogoMachadoMarques opened this issue Mar 20, 2017 · 2 comments

Comments

@DiogoMachadoMarques
Copy link

DiogoMachadoMarques commented Mar 20, 2017

I created an attribute =

email: {
  type: "email",
  required: true,
  unique: true
}

And when you run Insert, it does not perform validation to single in the table.

@ferrants
Copy link
Collaborator

I'm not sure if unique will work at all with this adapter. If there is support, you would need to set a hash index on that attribute. I don't see another way that it would work with dynamo. Want to try setting a hash on that and trying?

@ShubhankarS
Copy link

Is Email also your primary key? If so, you can set the attributes as:

email: {
  type: "email",
  required: true,
  primaryKey: 'hash'
}			

However, as far as I've seen, adding a duplicate entry for the primaryKey through the adapter will overwrite the document that already exists with that particular primaryKey

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

3 participants