Sign In Register

How can we help you today?

Start a new topic
Answered

Is there a way to remove record in system collections using cloud code?

Hi, i've been following this guide to make a Social Friends System using GS. 

https://support.gamesparks.net/support/discussions/topics/1000053058


Based on the guide, NoSQL will create a "challengeInstance", "playerMessage" and other system collections after I've made/accept a friend request. Hence, if I've made/accepts 10 friend requests, the "challengeInstance" system collection will keep 10 records. 


Since this record will keep accumulating over time, is it good/normal? From what I've researched I know that system collections are read-only and not read/write?


 Is there any solution so I could somehow auto-remove the record, after accepting/denying a friend request. I tried to code in cloud code to manually remove the system collections. Eg: var playerMsg = Spark.systemCollection("playerMessage");. playerMsg.remove(seen:true}.  But if i manually remove it in NoSQL, it works. But do I have to do this all the time if I want to keep maintenance for my game in future?




Best Answer

Hi Shiwen,


No there is no way to remove this System Collection data using Cloud Code currently. Manually deleting it is not a supported method so i wouldn't recommend doing this. It's absolutely fine for these collections to accumulate this amount of data, that's what they are there for so you won't have to worry about them getting too big over time, you can just leave them as they are.


Thanks,

Liam


Answer

Hi Shiwen,


No there is no way to remove this System Collection data using Cloud Code currently. Manually deleting it is not a supported method so i wouldn't recommend doing this. It's absolutely fine for these collections to accumulate this amount of data, that's what they are there for so you won't have to worry about them getting too big over time, you can just leave them as they are.


Thanks,

Liam

Ah great!  I shall continue to proceed on with following the social friends system guide.

Thanks alot for the feedback.


Regards,

Shiwen

Login to post a comment