Document reference
Solution
Use the Select
function:
{
document: {
ref: Ref(Collection("users"), "1"),
ts: 1668013995250000,
data: { name: 'Alice Crypto', email: 'alice@site.example.com' }
},
reference: Ref(Collection("users"), "1"),
'reference collection': Collection("users"),
'collection name': 'users',
'document ID': '1'
}
Discussion
The example uses the Let
function to fetch the document, and then
return an object that reports the document itself, the document’s
reference, and the components of the document reference.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!