Subscribe for watching a node or things in ThingsDB. A successful run request will respond with a
OK (17) package.
IDs are the thing-IDs you want to watch.
The socket needs to be authorized before sending a
See the auth example for how to authorize a socket connection.
As an example we assume that we want to watch a thing with Id 3 for mutations. Instead of a single ID, we could add as much IDs as we wanted.
ThingsDB will throw a
WARNING event to you socket connection in case some given Id does not exist within the given collection scope.
Other IDs will be watched and the response to you watch request will still be
This is the data we want to pack:
Serializing the above using MessagePack results in the following
Now we create the header. For this example we just use Id 0:
Sending the Query package
Responding OK package
See the watching documentation for more information.