My database has a parent collection that relates to a lot of child collections, the parent has a pre existing document created, and i want to create the child document, linking the child to the parent, is it possible to just do something like
let response_data = {
"child_attr": "child_data"
};
const resp = await databases.updateDocument(
'database_id',
'parent_collection_id',
'parent_document_id',
response_data
);
i tried doing it this way, and it never returned an error, but also never went to the rest of my function, so it returned:
Return statement missing. return context.res.empty() if no response is expected.
TL;DR
Developers want to create a child document linked to a pre-existing parent document. The code provided updates the parent document instead of creating a new child document. To create a child document, a new method specifically for that is needed.