Airplane
Airplane3y ago

Manually creating Id objects

is there a way to convert a string into a document ID (e.g. into a GenericId<"table">)?
3 Replies
ballingt
ballingt3y ago
You can just construct a GenericId (or Id if you're using a schema) with the new keyword, but it's an unusual thing to do because the only places Ids come from is from the database, where they're already objects. Useful if you're deserializing your own serialization though.
ballingt
ballingt3y ago
No description
jamwt
jamwt3y ago
@Airplane ids also support toJSON and fromJSON, in case that's useful

Did you find this page helpful?