Store an instance of a class extending @colyseus/schema into a database

4 Jun 2020, 18:38

Is there a way to store an instance of a class extending @colyseus/schema directly into a database?

4 Jun 2020, 18:47

hi @virtumonde, you could use instance.toJSON() and store that. you'd need to have your own way to restore/instantiate those objects by yourself when retrieving them from the database if you need to

4 Jun 2020, 18:55

Thank you, @endel. I will publish another quick question as a new thread if you don't mind.