Hello folks, I’ve been reading on the storage documentation and do not seem to get this working for my game.
I’m writing this object to the storage (note I even added a public read). Each player should submit a caption for a given photo.
Once all the N players have submitted their captions, I should have N values for key “matchState.CurrentImageId” in the “captions” collection. This part is behaving as expected, and I can see the collection with the right key on the admin console.
When the last player submits their caption I need to lookup all the captions for key “matchState.CurrentImageId” inside “captions” and send them back to the client. Based on the documentation, I think Storage Read seems like the perfect function for this. Since I need all of the objects in this collection and key I’m not passing a UserId on my storageRead object.
The output of this Storage Read is an empty array, I thought because this is a call from the server it should have access to all the data in the collection. What I expected as the output of this function was to get the N elements inside the “captions” collection that have the key"matchState.CurrentImageId".
I did also try adding a UserId to my storage object but I only get the object that belongs to the current player calling the function which is not what I want.
I also tried using StorageList which does work fine but I get back all the objects in the collection. In this case I’m loading a bunch of data that I do not need, I only need the ones with key: “matchState.CurrentImageId”
Could you explain me what I’m doing wrong? I thought StorageRead from the server has access to all the objects on a collection similar to how StorageList works.
- Versions: Nakama 3.17.1, Windows, Docker
- Server Framework Runtime language (If relevant) go 1.20