Sign In Register

How can we help you today?

Start a new topic
Answered

Any way to add custom keys to the response instead of in ScriptData?

Till now this is the best platform I have tried so far (trying GS from couple of months).


One Answer I want to know regarding custom keys. Any way to configure custom keys so that we can directly get in the response data instead of in script data?


ex : While fetching the challenge list, In each challenge  for each user i want to store the scores. Currently Im using scriptdata which is pretty confusing to manage the keys as the customisation goes big. It would be handy if we can configure the response format so that its very easy to integrate extra details done with cloud code.


If not any plans for this in future?


Thanks,

Ayyappa.


Best Answer
Hey Ayyappa,

Getting data out of scriptdata collections can be a pain on the client-side, but you can always create custom data-structures in your own collections, or just send an array instead of a mongodb collection, so they are a little easier to parse.

If it gets too complicated to try and keep everything in one collection when you send it using setScriptData(), you can send multiple sets of script data so long as they all have unique keys. On the client-side you can grab the data as using that key.

 



1 person has this question
1 Comment

Answer
Hey Ayyappa,

Getting data out of scriptdata collections can be a pain on the client-side, but you can always create custom data-structures in your own collections, or just send an array instead of a mongodb collection, so they are a little easier to parse.

If it gets too complicated to try and keep everything in one collection when you send it using setScriptData(), you can send multiple sets of script data so long as they all have unique keys. On the client-side you can grab the data as using that key.

 


Login to post a comment