SDK
SDK Golang v3.x
2

Notifications #

The Realtime.Subscribe method takes a channel for types.NotificationResult objects, whose content depend on the type of notification received.

Document & messages #

These notifications represent documents changes & messages.

PropertyTypeDescription
ActionstringAPI controller's action
CollectionstringData collection
ControllerstringAPI controller
IndexstringData index
ProtocolstringNetwork protocol used to modify the document
Result*types.NotificationResultNotification content
RoomIdstringSubscription channel identifier. Can be used to link a notification to its corresponding subscription
Scopestringin: document enters (or stays) in the scope
out: document leaves the scope
TimestampintTimestamp of the event, in Epoch-millis format
Typestringdocument: the notification type
Volatilejson.RawMessageRequest volatile data

The Result property has the following structure for document notifications & messages:

PropertyTypeDescription
idstringDocument unique ID
null if the notification is from a real-time message
contentjson.RawMessageA JSON String message or full document content. Not present if the event is about a document deletion

User #

These notifications represent user events.

PropertyTypeDescription
ActionstringAPI controller's action
CollectionstringData collection
ControllerstringAPI controller
IndexstringData index
ProtocolstringNetwork protocol used by the entering/leaving user
Result*types.NotificationResultNotification content
RoomIdstringSubscription channel identifier. Can be used to link a notification to its corresponding subscription
TimestampintTimestamp of the event, in Epoch-millis format
Typestringuser: the notification type
Userstringin: a new user has subscribed to the same filters
out: a user cancelled a shared subscription
Volatilejson.RawMessageRequest volatile data

The Result property has the following structure for user events:

PropertyTypeDescription
countintUpdated users count sharing that same subscription