serverless-seoul / dynamorm

AWS DynamoDB ORM in Typescript
Apache License 2.0
55 stars 4 forks source link

Documentation: primaryKey hash #19

Closed ostmond closed 3 years ago

ostmond commented 3 years ago

In the document on https://serverless-seoul.github.io/dynamorm/docs/quick-start it hashes the primaryKey to number: public static readonly primaryKey: Query.HashPrimaryKey<BlogPost, number>;

But by searching it calls with string: let post = await BlogPost.primaryKey.get("first-blog-post");

It gave me error notification in VS-Code. I suppose it should be hashed to string: public static readonly primaryKey: Query.HashPrimaryKey<BlogPost, string>;

Shouldn't it?

breath103 commented 3 years ago

Hi, yes it is. since "id" is primaryKey. will fix the docs soon, or you can commit change to PR

breath103 commented 3 years ago

fixed, thanks for the report