Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Created March 30, 2020 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianleroux/5a16fd9dc4c8aff33ae922c0b3b7f466 to your computer and use it in GitHub Desktop.
Save brianleroux/5a16fd9dc4c8aff33ae922c0b3b7f466 to your computer and use it in GitHub Desktop.
// sign up save the data by creating a dynamic index..
await begin.set([
{table: `users`, key: userID, email, name, etc},
{table: `user-${ email }`, key: userID, email, name, etc}
])
@brianleroux
Copy link
Author

this has the tradeoff that you maintain the data in two places (but hey batch writes are free!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment