You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that SurrealDB uses Thing which is the table:id combination. Is there an organic way of preserving a normal Id? Or is there a way to get the id when deserializing?
In my case, the ID is an autogenerated string by another API. I cannot store that in a field called Id because i would get deserialization errors, as SurrealDB stores that as Thing.
I could rename the field
structPerson{person_id:String,name:String}
But then i have to fields that represent the same (id and person_id) but they are separated and unique, which means that I'll have to update both manually.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I know that SurrealDB uses
Thing
which is thetable:id
combination. Is there an organic way of preserving a normal Id? Or is there a way to get the id when deserializing?Take this example
In my case, the ID is an autogenerated string by another API. I cannot store that in a field called
Id
because i would get deserialization errors, as SurrealDB stores that asThing
.I could rename the field
But then i have to fields that represent the same (id and person_id) but they are separated and unique, which means that I'll have to update both manually.
What's the best way of doing this?
Beta Was this translation helpful? Give feedback.
All reactions