I want to clean the server and erase those challenges who expired and do automatically but I dont find any Cloud Coud APi to do that.
Any help ? thanks.
Best Answer
C
Customer Support
said
over 5 years ago
Hi Guys,
Currently there is no way to remove Expired Challenges from the ChallengeInstanceID collection, they will always remain in that collection in an "EXPIRED" state. The above example “var collection = Spark.runtimeCollection('challengeinstance');” won't work as the ChallengeInstance Collection is a System Collection and not a Runtime one. System collections are read only and not accessed like a normal collection. You can use SparkChallenge in Cloud Code to access the details of a particular challenge.
You can also use a ListChallengeRequest to list all of the challenges that exist in a particular state. A FindChallengeRequest will return a list of challenges that the current player is eligible to join.
Yes luis. Im seeing same thing. Its returning sucess in cloud script but in db it still exists.
Any one from GameSparks pls look into this?
1 person likes this
L
Luis Vieira
said
almost 6 years ago
. Any one from GameSparks pls look into this?
Customer Support
said
almost 6 years ago
Hi Luis,
We are looking in to this at the moment.
Will update you here.
THanks,
Oisin
P
Peter Richmond
said
over 5 years ago
was there any solution to this?
Thanks
Customer Support
said
over 5 years ago
Answer
Hi Guys,
Currently there is no way to remove Expired Challenges from the ChallengeInstanceID collection, they will always remain in that collection in an "EXPIRED" state. The above example “var collection = Spark.runtimeCollection('challengeinstance');” won't work as the ChallengeInstance Collection is a System Collection and not a Runtime one. System collections are read only and not accessed like a normal collection. You can use SparkChallenge in Cloud Code to access the details of a particular challenge.
You can also use a ListChallengeRequest to list all of the challenges that exist in a particular state. A FindChallengeRequest will return a list of challenges that the current player is eligible to join.
Thanks,
Liam
O
Otto Lopes Braitback de Oliveira
said
over 4 years ago
Hi Liam,
what do you suggest to avoid loading several challenges? In my case, completed challenges with winner aren't important for user to load. So I tried to remove all challenge players, I got an error but it seems to work well for me.
It should be great to have a function to delete challenge.
Thanks
M
Mubeen Iqbal
said
over 4 years ago
Hi guys,
To remove all the expired challenges just go to the NOSQL tab and then inside it go to the "Remove" tab. Write this query:
{ "state" : "EXPIRED" }
and submit. All the EXPIRED challenged will be deleted.
Luis Vieira
Hi,
I want to clean the server and erase those challenges who expired and do automatically but I dont find any Cloud Coud APi to do that.
Any help ? thanks.
Hi Guys,
Currently there is no way to remove Expired Challenges from the ChallengeInstanceID collection, they will always remain in that collection in an "EXPIRED" state. The above example “var collection = Spark.runtimeCollection('challengeinstance');” won't work as the ChallengeInstance Collection is a System Collection and not a Runtime one. System collections are read only and not accessed like a normal collection. You can use SparkChallenge in Cloud Code to access the details of a particular challenge.
You can also use a ListChallengeRequest to list all of the challenges that exist in a particular state. A FindChallengeRequest will return a list of challenges that the current player is eligible to join.
Thanks,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstAyyappa R
Hi,
After seeing your question, I went ahead and wrote a system script to delete some entries from collection.
Here, just for checking, I tried with RUNNING games state.
var collection = Spark.runtimeCollection('challengeinstance');
var result = collection.remove({"state":"RUNNING"});
Spark.getLog().error("Removed Running Event" + collection + " success ? "+ result);
Its returning success but, once i go to NO SQL section, it still shows the running challenge.
Any one from GameSparks can help on this?
Luis Vieira
mmmmm interesting
Luis Vieira
I inly can remove my own Challengue?
Any GameSparks guest?
Ayyappa R
Do you mean , you can remove only the one created by you?
Luis Vieira
Sorry my bad.
Yes, I dont know why its not working.
I try:
And the Log I recieved:
But I my NOSQL I still have Challenge Completed
Ayyappa R
1 person likes this
Luis Vieira
. Any one from GameSparks pls look into this?
Customer Support
Hi Luis,
We are looking in to this at the moment.
Will update you here.
THanks,
Oisin
Peter Richmond
was there any solution to this?
Thanks
Customer Support
Hi Guys,
Currently there is no way to remove Expired Challenges from the ChallengeInstanceID collection, they will always remain in that collection in an "EXPIRED" state. The above example “var collection = Spark.runtimeCollection('challengeinstance');” won't work as the ChallengeInstance Collection is a System Collection and not a Runtime one. System collections are read only and not accessed like a normal collection. You can use SparkChallenge in Cloud Code to access the details of a particular challenge.
You can also use a ListChallengeRequest to list all of the challenges that exist in a particular state. A FindChallengeRequest will return a list of challenges that the current player is eligible to join.
Thanks,
Liam
Otto Lopes Braitback de Oliveira
Hi Liam,
what do you suggest to avoid loading several challenges? In my case, completed challenges with winner aren't important for user to load. So I tried to remove all challenge players, I got an error but it seems to work well for me.
It should be great to have a function to delete challenge.
Thanks
Mubeen Iqbal
Hi guys,
To remove all the expired challenges just go to the NOSQL tab and then inside it go to the "Remove" tab. Write this query:
{ "state" : "EXPIRED" }
and submit. All the EXPIRED challenged will be deleted.
1 person likes this
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics