A few questions about Storage

0 votes


While experimenting with additional data, I noticed the json object has the following info

- ACL List

- Creation time

- Update time

- Doc Id

- GeoLoc

- Document content

- Assigned event

- owner (player/user)


Now, the DB is pretty obvious since I queried the information and as we discussed in my previous question, an app can only have one DB. But how do I know what source collection this doc is from? Assuming I use a generic callback which I would recycle for any related tasks, how can I filter the information or use proper conditions to know what game/app calls to do inside my project?

The doc id is dynamic and hardocding it might not be the wisest idea. Can you please add a collectionName (or sourceCollection or whatever name you deem fit) property inside the json object? It seems like a vital information and it's a shame it's missing as it can allow for so much more dynamic coding. Not a priority for now as I wil try to limit my callback objects to specific tasks, but this will result in redundant code (and over-subclassing will result in overkill). I don't think it's difficult to add :)  (even with low priority)

Adding an option to use a new call to get this information may seem too much. Simplest method as I see it is to be another metadata property like creation date, doc id etc.

Similar question: using the same callback for similar API calls (i.e. one callback for 4-5 user-services requests) I can't always know what request I get a response for (if it's a standalone autonomous and dynamic callbcack). Can the request name be added as well in the response? Like GetRolesByUser, GetUser etc. but for all requests? Not a priority cos I'll just do some IFs but a request name in the response metadata like the collection source idea would be a lot cleaner :) If possible.

Second issue: I can use metadata with UserServices.Authenticate (i.e. getting the profile), but it won't let me use queries. Is this by design or just not implemented? I tried several combinations and it will ignore any documents the user has. Only User functions will return queries. The main reason I ask, I will be honest, is to reduce API calls :)




P.S. small cosmetic bug: in the storage menu -> json submenu there is a search button but it says "Advance Search" instead of "Advanced Search" :)

asked Jul 23, 2018 in Unity by xian_ef (35 points)
edited Jul 28, 2018 by xian_ef

1 Answer

0 votes
Hi Xian,

Apologies for the delayed response.

For the first question, there is another way to this, you can add the collection name in the json docs while saving it and when you fetch it you will have the collection name associated with the doc. However, I will discuss this with my production team to add collection name by default if possible.

For your 3rd query, Yes, queries are not allowed with user authenticate API as of now. You can only get profiles with this API.

I hope it helps.

answered Jul 27, 2018 by rajeev.etc (1,660 points)
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