Skip to content

Instantly share code, notes, and snippets.

@mxro
Created June 17, 2022 23:42
Show Gist options
  • Select an option

  • Save mxro/ccef55f989810812142a2ef2c418faaa to your computer and use it in GitHub Desktop.

Select an option

Save mxro/ccef55f989810812142a2ef2c418faaa to your computer and use it in GitHub Desktop.
const table = await connectTable();
const Users = UserEntity(table);
await Users.put({
pk: 'joe@email.com',
sk: 'admin',
name: 'Joe',
emailVerified: true,
});
const { Item: user } = await Users.get<User, UserKey>(
{ pk: 'joe@email.com', sk: 'admin' },
{ attributes: ['name', 'pk'] }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment