Search code examples
google-drive-apigoogle-drive-realtime-api

Google Realtime API - How to view existing collaboration model?


How do I view existing realtime collaboration data model? I call getRoot method:

var collaborative_model = rtpg.realtimeDoc.getModel().getRoot()

When I vew collaborative_model object in debug, I see cryptic properties only. Not sure if or how my model is saved.

Can I do some kind of variable dump of the model?

enter image description here


Solution

  • The root is just a CollaborativeMap, so you can use the standard map methods to explore its values.

    The relevant methods there for digging into the model are keys() and values().

    A lot of these data model classes have obfuscated methods that are a part of the internal implementation. The best way to see what methods are publicly available is to look at the API reference.