Sign In Register

How can we help you today?

Start a new topic

Clear data during development

Hi, how do we clear an entire collection during development? ie: if we have a bunch of test players and we want to delete them all without having to delete each document individually?


Hi Jedzej,


Runtime collections can be cleared using the remove tab in the NoSQL explorer by specifying a query for the documents to remove. System collections however like the player collection should not be cleared, these collections are depended upon by various other parts of the platform and can have unintended side effects if cleared. The best thing to do for a fresh instance would be to copy a snapshot over to a new instance or use the build in player remove functions to remove specific players. I hope this answers your question.


Kind regards,

 - Steve

Thanks.


Can you give me a specific example of a query that would remove all entries from a runtime collection?


What are the "build in player remove functions"?


-JJ

Hi JJ,

Have you had a look at our documentation here (https://docs.gamesparks.com/api-documentation/cloud-code-api/player/sparkplayer.html#deleteplayer) this is the built in player remove function I was talking about. A simple query that will match all records could be just {}. I hope this helps.

Kind regards,
 - Steve

 

Login to post a comment