Objects are located in the database by paths. Let’s imagine we want to generate or work with this database model:
Samples
/chats/chatA/members
/users/774562384
Models
It’s so easy to work with JSON objects. In JavaScript it’s done as associative arrays:
In Android, Rotor works with Java or Kotlin apps. For work with JSON objects in Java define classes with the fields of the desired model. Rotor libraries work with GSON and make that work for you. Check remote objects page for more documentation:
In Kotlin you can’t work with data classes for JSON de/serialization. Use Java objects instead.
I couldn’t do GSON work with data class with var fields (variables). With val fields (values) works, but it’s immutable