fmmmmmzOriginal post
Web Developer
Hi!
I'm testing the realtime in web, and it works flawlessly.
I call for an specific ID in the collection, so the document is the only thing I'm subscribing at, but the relationships defined in the DB are not present in that change, nor does it triggers the change when the a related entry gets created or updated. Is this expected? or is there a way to configure this differently? I could not find any docs about this particular topic.
export const subscribe = async (collection: string, document: string) => {
const unsubscribe = await client.subscribe(
`databases.${
DBID as any
}.collections.${collection}.documents.${document}`,
(response) => {
console.log('hello', response);
}
);
return unsubscribe;
};
In the payload Im expecting the object.
{ ...myData, messages (the relationship) } But only get { ...myData }
Thanks in advance!
Summary
Developers are using realtime subscription in the web successfully, but are not receiving changes to related entries in the database when subscribing to a specific document. The code seems to be missing a way to handle relationships in the subscription.
Solution: To include related entries in your realtime subscription, consider restructuring the code to include logic that captures changes to related documents in the database.