As mentioned in the previous lesson, a tempid can simply be the collection name, i.e.
However, if you would like to reference that tempid somewhere else in your transaction, it is necessary to create a unique tempid. To make a unique tempid, just append the collection with any non-valid collection character (anything other than
_) followed by anything else. For example,
In the below example, we are creating both a person and a chat message. We are using the person's tempid as a reference in
"fullName": "Joy Tan"
"message": "This is a message from Joy!",
Add a Person and a Chat
Write a transaction!
Using the above transaction example, create your own person and chat, and reference that person as `chat/person`.