peak-ai / jedlik

DynamoDB ODM for Node
MIT License
106 stars 4 forks source link

Create key condition #1

Closed lukemurray7 closed 5 years ago

lukemurray7 commented 5 years ago

Need to be able to add KeyConditionExpression to save (put) requests. It can either be attribute_not_exists... for create, or attribute_exists ... for edit

EwanValentine commented 5 years ago

I'd suggest the correct approach for this would be via the schema, so from the examples in the docs:

const schema = {
  propertyName: {
    required: true,
    default: 'any value'
    unique: true // HERE
  },
};

Can help with that later.

Probably look at adding it in here? https://github.com/PeakBI/jedlik/blob/develop/src/apply-schema.js

harrim91 commented 5 years ago

This is what I was intending also ☝️ should probably have written some stuff down 😆