Greg Brimble | Cloudflare Pages
04/04/2021, 10:35 AMlar
04/04/2021, 10:46 AMGreg Brimble | Cloudflare Pages
04/04/2021, 11:05 AMGreg Brimble | Cloudflare Pages
04/04/2021, 11:05 AMSubh
04/04/2021, 1:24 PMUser
- Albums
- Posts
A user can have N numbers of Albums and Post.Greg Brimble | Cloudflare Pages
04/04/2021, 1:44 PMGreg Brimble | Cloudflare Pages
04/04/2021, 1:46 PMdeleteAll()
.Subh
04/04/2021, 1:53 PMSubh
04/04/2021, 1:56 PMvans163
04/04/2021, 2:05 PMeidam | SuperSaaS
04/04/2021, 2:05 PMvans163
04/04/2021, 2:05 PMvans163
04/04/2021, 2:05 PMKevin W - Itty
04/04/2021, 2:07 PMKevin W - Itty
04/04/2021, 2:07 PMSubh
04/04/2021, 2:07 PMGreg Brimble | Cloudflare Pages
04/04/2021, 2:08 PMnewUniqueId()
generation for each of the instances of those classes.
Depending on how you're doing auth, you'd probably 'enter' through User
, which on it, lists the IDs of `Album`s that it owns. (Same for `Album`s โ `Post`s).Greg Brimble | Cloudflare Pages
04/04/2021, 2:10 PMfirstName โ Greg
lastName โ Brimble
album:78327 โ 78327
album:25627 โ 25627
And then do state.storage.list({ prefix: "album:" })
which will return the list of album keys. Then you can just env.Album.get(id)
.vans163
04/04/2021, 2:11 PMSubh
04/04/2021, 2:11 PMvans163
04/04/2021, 2:11 PMGreg Brimble | Cloudflare Pages
04/04/2021, 2:11 PMvans163
04/04/2021, 2:12 PMvans163
04/04/2021, 2:12 PMSubh
04/04/2021, 2:12 PMstate.storage.list({ prefix: "album:", date: "startFrom" })
or something similar to quary?Greg Brimble | Cloudflare Pages
04/04/2021, 2:13 PMvans163
04/04/2021, 2:13 PMvans163
04/04/2021, 2:13 PMGreg Brimble | Cloudflare Pages
04/04/2021, 2:14 PMGreg Brimble | Cloudflare Pages
04/04/2021, 2:14 PM