Hi. I try to use custom code.
In tutorial said:
"saveOrUpdateDocumentByKeyValue This key value pair will be searched in the JSON doc stored in the cloud and matching doc will be updated with the new value passed."
I want to update specific keys in whole json document. Icreate JSONObject with updated chunk of data like that:
final JSONObject updatedData= new JSONObject();
updatedData.put( Shared.KEY_SENDED_REQUESTS, initiatorSendedRequestsList ); // initiatorSendedRequestsList JSONArray
updatedData.put( Shared.KEY_USER_ID, mInitiatorId ); // mInitiatorId String
mStorageService.saveOrUpdateDocumentByKeyValue( Shared.DATABASE_NAME, Shared.COLLECTION_FRIENDS, Shared.KEY_USER_ID, mInitiatorId, updatedData);
But this method will owerride entire document or completely create new document with just updated data. Why, what i'm doing wrong?
I think i have to use addOrUpdateKeys but StorageService in custm code java sdk doesn't have this method. Why?
--------------------------------------------------------------------
Ok. Iresolve issue with document overriding by updating App42 Java lib and replace saveOrUpdateDocumentByKeyValue by addOrUpdateKeys . I think developers should update eclipse sample project.
But what diffetence between saveOrUpdateDocumentByKeyValue and updateDocumentByKeyValue, they both override existing document.
[ Custom code, Java ]
--------------------------------------------------------------------
Ia have one more question. Is custom code calls executed in queue?
Suppose sittuation. Client1 call Func1, and Client2 call Func2.
First execute Func1 and then Func2, or they will be invoked in parallel?