alon1874Original post
Rank 1: Thread
Hey,
I'm trying to subscribe to changes on a specific document (right after its creation). After creating the record, This code doesn't get triggered:
client?.subscribe(databases.aidb.collections.records.documents.${record["id"]}, response => {
Calling the same flow with
client?.subscribe(databases.aidb.collections.records.documents, response => {
works fine. What can be the issue?
Summary
The developer is having trouble subscribing to changes on a specific document. The code they provided doesn't trigger the subscription after creating the record. However, subscribing to changes on the entire collection works fine. They are asking for help in identifying the issue.
Solution: The issue may be with the way the document ID is being passed in the subscription code. Verify that the `record["id"]` value is correct and matches the ID of the newly created document.