What was key key value for document ?

0 votes
Hi i have created a json file for a user when i try to update the file i need to give key to the file but i dont have any idea what key was since i havent created any key while uploading the json file. i am using unity 3d i want to save the player score i was able to save but i dont know how to retrive the score since i have to provide document id or key i am looking for solution where if player have lost document id name in local storage,from the player settings. i should be able to find the document and update the document. provide me a demo script to set any key value so i can use 4- 5 documents one for player settings one for player score and one for player stats etc.
asked Mar 6, 2017 in Unity by risheelatrichflair (10 points)

1 Answer

0 votes

HI Risheel,

 

If you are not managing any key/value along with user score in Storage service then I would suggest you to call the below function before inserting a document in No-SQL Storage service.

App42API.SetLoggedInUser("UserName");

Using the above function, your document will have owner attached with the inserted document. So that later on if you missed the document id from player settings, you can fetch and updated the document based on the owner. 

To find/updated the document based on the owner, please have a look into this thread and let me know if you need any other assistance from our side. 

 

Regards,

Himanshu Sharma

answered Mar 7, 2017 by hs00105 (2,005 points)
HI i have noticed that any user can read any user data using search using the key of the json key value.

is there any simple way to create document with custom name like score , stats etc so that Say "userD" will only have document named "Score".

i can set documentId as score with out need of searching the document.
Hi Risheel,

Regarding your security concern of any user can read the data inside storage service, can be easily resolved, by applying object level security on the data. Please have a look at this link (http://api.shephertz.com/tutorial/Securing-Your-App/?index=security-acl) which will help you for the same. About your concern of simple way to create document, it depends on your requirement and application design through App42 Service, you can save your customize JSON which complete your objective.

Let me know if any help required from our end.  

Regards,
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...