How to use "FindDocumentByKeyValue" ?

0 votes

Hello, I'm using this functin to save some of my data
 


storageService.SaveOrUpdateDocumentByKeyValue(GameVars.dataDB, GameVars.collectionName, OnAuthenticate.username, "Coins", jsonDoc, new OnCoinsSaved());   


It works, but dont Update existing data, its allways create a new entry... Why it wont update it?
And another, main question is why I cant load this data? I'm trying this:
 


storageService.FindDocumentByKeyValue(GameVars.dataDB, GameVars.collectionName, OnAuthenticate.username, "Coins", new OnCoinsLoad()); 
 


And getting error

Exception : com.shephertz.app42.paas.sdk.csharp.App42NotFoundException: {"httpErrorCode":"404", "appErrorCode":"2601", "message":"Not Found", "details":"Document by key 'www' and value 'Coins' does not exist."}

asked Jun 17, 2015 in App42 Cloud API-BaaS by nbg_yalta (10 points)

1 Answer

0 votes

Hello,

The exception message which you have shared occured when you have no document in that collection for the given key/value. So could you please print the internal logs of both SaveOrUpdateDocumentByKeyValue or FindDocumentByKeyValue methods and share with us. It will help us to provide better support to you. 

To print the internal logs, put the below line of code just after the initialize method of App42 API:

App42Log.SetDebug(true);

Thanks,

Himanshu Sharma

answered Jun 17, 2015 by hs00105 (2,005 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
...