No we don't support FLUSHDB. As Redis is used for some system purposes as well as custom data the method would clear that data too which would not be ideal. For now you can use the code supplied by Tech Support above to clear the data. I'll add a Feature Request to our backlog on your behalf for a method that will clear custom data.
Thanks,
Liam
R
Ryan George
said
over 6 years ago
That makes sense. Just to make sure we're clear: are those system-level Redis entries visible to us? If I remove every key I have access to, I won't accidentally remove any of your system level Redis KVPs?
Thanks for the info.
Customer Support
said
over 6 years ago
Hi Ryan,
No they are not visible to you. They aren't exposed so scenarios such as the one described by you above can be avoided.
Ryan George
Is there any way for me to clear all my Redis keys?
var allKeys = Spark.getRedis().keys(*)
for(var i=0 ; i<allKeys.length ; i++){
Spark.getRedis().del(allKeys[i]);
}
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstTech Support
var allKeys = Spark.getRedis().keys(*)
for(var i=0 ; i<allKeys.length ; i++){
Spark.getRedis().del(allKeys[i]);
}
Jeff Amiel
or how about Spark.getCache().removeAll() ?
Ryan George
@Tech Support:
So we don't have any access to calls like FLUSHDB?
@Jeff:
That is for SparkCache, which is an entirely separate system backed by Mongo. https://docs.gamesparks.com/api-documentation/cloud-code-api/cloud-data/sparkcache.html
Customer Support
Hi Ryan,
No we don't support FLUSHDB. As Redis is used for some system purposes as well as custom data the method would clear that data too which would not be ideal. For now you can use the code supplied by Tech Support above to clear the data. I'll add a Feature Request to our backlog on your behalf for a method that will clear custom data.
Thanks,
Liam
Ryan George
That makes sense. Just to make sure we're clear: are those system-level Redis entries visible to us? If I remove every key I have access to, I won't accidentally remove any of your system level Redis KVPs?
Thanks for the info.
Customer Support
Hi Ryan,
No they are not visible to you. They aren't exposed so scenarios such as the one described by you above can be avoided.
Thanks,
Liam
-
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 2487 topics